From 9527aa404253db488599314bdd3c34a14ea05970 Mon Sep 17 00:00:00 2001 From: z0ffy <654109707@qq.com> Date: Mon, 11 Nov 2024 00:45:12 +0800 Subject: [PATCH] chore: fix eslint --- .eslintrc.json | 19 ------------------- eslint.config.mjs | 22 +++++++++++++--------- package.json | 2 ++ pnpm-lock.yaml | 6 ++++++ 4 files changed, 21 insertions(+), 28 deletions(-) delete mode 100755 .eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100755 index 4d334ae..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": [ - "next/core-web-vitals" - ], - "rules": { - "indent": [ - "error", - 2 - ], - "import/extensions": [ - "error", - "ignorePackages", - { - "tsx": "never", - "ts": "never" - } - ] - } -} diff --git a/eslint.config.mjs b/eslint.config.mjs index 8de54fd..f63582f 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -11,13 +11,17 @@ const compat = new FlatCompat({ allConfig: js.configs.all }); -export default [...compat.extends("next/core-web-vitals"), { - rules: { - indent: ["error", 2], +export default [ + ...compat.extends("next/core-web-vitals"), + { ignores: [".next/*", "eslint.config.mjs"] }, + { + rules: { + indent: ["error", 2], - "import/extensions": ["error", "ignorePackages", { - tsx: "never", - ts: "never", - }], - }, -}]; + "import/extensions": ["error", "ignorePackages", { + tsx: "never", + ts: "never", + }], + }, + } +]; diff --git a/package.json b/package.json index 010b322..b96297c 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,8 @@ "sakana-widget": "^2.7.0" }, "devDependencies": { + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "^9.14.0", "@types/node": "22.9.0", "@types/react": "18.3.12", "@types/react-dom": "18.3.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 94ea06e..08d8c89 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -45,6 +45,12 @@ importers: specifier: ^2.7.0 version: 2.7.0 devDependencies: + '@eslint/eslintrc': + specifier: ^3.1.0 + version: 3.1.0 + '@eslint/js': + specifier: ^9.14.0 + version: 9.14.0 '@types/node': specifier: 22.9.0 version: 22.9.0