From d167f6295d8fd2001306569555c1ec5eb7eae2eb Mon Sep 17 00:00:00 2001 From: satnaing Date: Tue, 25 Feb 2025 19:57:49 +0700 Subject: [PATCH] build: upgrade ESLint and its related packages --- .prettierignore | 2 +- eslint.config.js | 20 ++++++++++++++++++++ eslint.config.mjs | 44 -------------------------------------------- package.json | 14 ++++++-------- 4 files changed, 27 insertions(+), 53 deletions(-) create mode 100644 eslint.config.js delete mode 100644 eslint.config.mjs diff --git a/.prettierignore b/.prettierignore index f03232f..f390211 100644 --- a/.prettierignore +++ b/.prettierignore @@ -9,5 +9,5 @@ !astro.config.ts !package.json !.prettierrc -!eslint.config.mjs +!eslint.config.js !README.md \ No newline at end of file diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..73fc7cd --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,20 @@ +import eslintPluginAstro from "eslint-plugin-astro"; +import globals from "globals"; +import jsxA11y from "eslint-plugin-jsx-a11y"; +import tseslint from "typescript-eslint"; + +export default [ + jsxA11y.flatConfigs.recommended, + ...tseslint.configs.recommended, + ...eslintPluginAstro.configs.recommended, + { + languageOptions: { + globals: { + ...globals.browser, + ...globals.node, + }, + }, + }, + { rules: { "no-console": "error" } }, + { ignores: ["dist/**", ".astro"] }, +]; diff --git a/eslint.config.mjs b/eslint.config.mjs deleted file mode 100644 index 2e95428..0000000 --- a/eslint.config.mjs +++ /dev/null @@ -1,44 +0,0 @@ -import js from "@eslint/js"; -import globals from "globals"; -import tseslint from "typescript-eslint"; -import astroParser from "astro-eslint-parser"; -import eslintPluginAstro from "eslint-plugin-astro"; - -export default [ - js.configs.recommended, - ...tseslint.configs.recommended, - ...eslintPluginAstro.configs.recommended, - { - languageOptions: { - globals: { - ...globals.browser, - ...globals.node, - }, - }, - }, - { - files: ["*.astro"], - languageOptions: { - parser: astroParser, - parserOptions: { - parser: "@typescript-eslint/parser", - extraFileExtensions: [".astro"], - }, - }, - }, - { - files: ["tailwind.config.cjs", "**/*.d.ts"], - rules: { - "@typescript-eslint/no-require-imports": "off", - "@typescript-eslint/triple-slash-reference": "off", - }, - }, - { - rules: { - "@typescript-eslint/no-unused-expressions": "off", - }, - }, - { - ignores: ["dist/**", ".astro"], - }, -]; diff --git a/package.json b/package.json index 240701e..82252aa 100644 --- a/package.json +++ b/package.json @@ -33,17 +33,15 @@ "@tailwindcss/typography": "^0.5.16", "@types/github-slugger": "^1.3.0", "@types/lodash.kebabcase": "^4.1.9", - "@types/react": "^19.0.8", - "@typescript-eslint/parser": "^8.23.0", - "astro-eslint-parser": "^1.2.1", - "eslint": "^9.20.0", + "@typescript-eslint/parser": "^8.25.0", + "eslint": "^9.21.0", "eslint-plugin-astro": "^1.3.1", - "globals": "^15.14.0", + "eslint-plugin-jsx-a11y": "^6.10.2", + "globals": "^16.0.0", "prettier": "^3.4.2", "prettier-plugin-astro": "^0.14.1", "prettier-plugin-tailwindcss": "^0.6.11", - "react": "^19.0.0", - "react-dom": "^19.0.0", - "typescript-eslint": "^8.23.0" + "typescript": "^5.7.3", + "typescript-eslint": "^8.25.0" } }