Skip to content

Commit a71d64f

Browse files
committed
Start over with eslint per Next latest config
Added TS and prettier, nothing else. TODO: Maybe come back and restore import/order or no-unused-vars
1 parent 306044a commit a71d64f

File tree

3 files changed

+18
-91
lines changed

3 files changed

+18
-91
lines changed

eslint.config.mjs

Lines changed: 18 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,20 @@
1-
import nextCoreWebVitals from "eslint-config-next/core-web-vitals";
2-
import nextTypescript from "eslint-config-next/typescript";
3-
import path from "node:path";
4-
import { fileURLToPath } from "node:url";
5-
6-
import { fixupConfigRules } from "@eslint/compat";
7-
8-
const __filename = fileURLToPath(import.meta.url);
9-
const __dirname = path.dirname(__filename);
10-
11-
const eslintConfig = [
12-
...fixupConfigRules(compat.extends("next/core-web-vitals", "next/typescript")),
13-
{
14-
rules: {
15-
"import/order": [
16-
"error",
17-
{
18-
alphabetize: {
19-
order: "asc",
20-
caseInsensitive: true,
21-
},
22-
23-
"newlines-between": "always",
24-
25-
pathGroups: [
26-
{
27-
pattern: "react",
28-
group: "builtin",
29-
position: "before",
30-
},
31-
{
32-
pattern: "@/**",
33-
group: "external",
34-
position: "after",
35-
},
36-
],
37-
38-
pathGroupsExcludedImportTypes: ["react"],
39-
40-
groups: ["builtin", "external", "internal", "unknown", "parent", "sibling", "index", "object", "type"],
41-
},
42-
],
43-
44-
"@typescript-eslint/no-unused-vars": [
45-
"error",
46-
{
47-
vars: "all",
48-
args: "after-used",
49-
ignoreRestSiblings: true,
50-
argsIgnorePattern: "^_",
51-
varsIgnorePattern: "^_",
52-
},
53-
],
54-
},
55-
},
56-
{
57-
ignores: ["node_modules/**", ".next/**", "out/**", "build/**", "next-env.d.ts"]
58-
}
59-
];
1+
import { defineConfig, globalIgnores } from "eslint/config";
2+
import nextVitals from "eslint-config-next/core-web-vitals";
3+
import nextTs from "eslint-config-next/typescript";
4+
import prettier from "eslint-config-prettier/flat";
5+
6+
const eslintConfig = defineConfig([
7+
...nextVitals,
8+
...nextTs,
9+
prettier,
10+
// Override default ignores of eslint-config-next.
11+
globalIgnores([
12+
// Default ignores of eslint-config-next:
13+
".next/**",
14+
"out/**",
15+
"build/**",
16+
"next-env.d.ts",
17+
]),
18+
]);
6019

6120
export default eslintConfig;

package-lock.json

Lines changed: 0 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232
"zod": "4.1.12"
3333
},
3434
"devDependencies": {
35-
"@eslint/compat": "1.4.1",
36-
"@eslint/js": "9.39.1",
37-
"@next/eslint-plugin-next": "16.0.1",
3835
"@tailwindcss/forms": "0.5.10",
3936
"@tailwindcss/postcss": "4.1.16",
4037
"@types/lodash.debounce": "4.0.9",
@@ -44,8 +41,6 @@
4441
"eslint": "9.39.1",
4542
"eslint-config-next": "16.0.1",
4643
"eslint-config-prettier": "10.1.8",
47-
"eslint-plugin-react": "7.37.5",
48-
"eslint-plugin-react-hooks": "7.0.1",
4944
"postcss": "8.5.6",
5045
"prettier": "3.6.2",
5146
"prettier-plugin-tailwindcss": "0.7.1",

0 commit comments

Comments
 (0)