Skip to content

Commit 306044a

Browse files
committed
Migrate eslint
Ran `npx @next/codemod@canary next-lint-to-eslint-cli .` see https://nextjs.org/docs/app/getting-started/installation#set-up-linting
1 parent 6127ff6 commit 306044a

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

eslint.config.mjs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1+
import nextCoreWebVitals from "eslint-config-next/core-web-vitals";
2+
import nextTypescript from "eslint-config-next/typescript";
13
import path from "node:path";
24
import { fileURLToPath } from "node:url";
35

46
import { fixupConfigRules } from "@eslint/compat";
5-
import { FlatCompat } from "@eslint/eslintrc";
6-
import js from "@eslint/js";
77

88
const __filename = fileURLToPath(import.meta.url);
99
const __dirname = path.dirname(__filename);
10-
const compat = new FlatCompat({
11-
baseDirectory: __dirname,
12-
recommendedConfig: js.configs.recommended,
13-
allConfig: js.configs.all,
14-
});
1510

1611
const eslintConfig = [
1712
...fixupConfigRules(compat.extends("next/core-web-vitals", "next/typescript")),
@@ -58,6 +53,9 @@ const eslintConfig = [
5853
],
5954
},
6055
},
56+
{
57+
ignores: ["node_modules/**", ".next/**", "out/**", "build/**", "next-env.d.ts"]
58+
}
6159
];
6260

6361
export default eslintConfig;

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dev": "next dev --turbopack -p 3030",
77
"build": "next build",
88
"start": "next start",
9-
"lint": "next lint",
9+
"lint": "eslint .",
1010
"format": "prettier --write .",
1111
"type-check": "tsc --noEmit"
1212
},
@@ -33,7 +33,6 @@
3333
},
3434
"devDependencies": {
3535
"@eslint/compat": "1.4.1",
36-
"@eslint/eslintrc": "3.3.1",
3736
"@eslint/js": "9.39.1",
3837
"@next/eslint-plugin-next": "16.0.1",
3938
"@tailwindcss/forms": "0.5.10",

0 commit comments

Comments
 (0)