Skip to content

Commit 4e61cb7

Browse files
committed
chore(website): add next plugin to eslint config
1 parent 825a22a commit 4e61cb7

File tree

5 files changed

+42
-21
lines changed

5 files changed

+42
-21
lines changed

examples/next-app/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "next-app",
33
"private": true,
44
"scripts": {
5-
"dev": "next dev",
65
"build": "next build",
6+
"dev": "next dev",
77
"start": "next start"
88
},
99
"dependencies": {
@@ -14,21 +14,21 @@
1414
"react-dom": "latest"
1515
},
1616
"devDependencies": {
17-
"autoprefixer": "10.4.20",
18-
"postcss": "8.4.41",
19-
"tailwindcss": "3.4.9",
2017
"@eslint-react/eslint-plugin": "workspace:*",
2118
"@eslint/config-inspector": "^0.6.0",
2219
"@eslint/js": "^9.17.0",
23-
"eslint": "^9.17.0",
24-
"eslint-plugin-react-hooks": "^5.1.0",
25-
"eslint-plugin-react-refresh": "^0.4.16",
26-
"typescript-eslint": "^8.18.0",
2720
"@next/eslint-plugin-next": "^15.1.0",
2821
"@types/negotiator": "^0.6.3",
2922
"@types/node": "^22.10.2",
3023
"@types/react": "^19.0.1",
3124
"@types/react-dom": "^19.0.2",
32-
"typescript": "^5.7.2"
25+
"autoprefixer": "10.4.20",
26+
"eslint": "^9.17.0",
27+
"eslint-plugin-react-hooks": "^5.1.0",
28+
"eslint-plugin-react-refresh": "^0.4.16",
29+
"postcss": "8.4.41",
30+
"tailwindcss": "3.4.9",
31+
"typescript": "^5.7.2",
32+
"typescript-eslint": "^8.18.0"
3333
}
3434
}

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,19 +97,19 @@
9797
},
9898
"pnpm": {
9999
"overrides": {
100+
"@types/react": "^19.0.1",
101+
"@types/react-dom": "^19.0.2",
100102
"array-flatten": "npm:@nolyfill/array-flatten@^1.0.42",
103+
"cross-spawn": "7.0.6",
101104
"is-core-module": "npm:@nolyfill/is-core-module@^1.0.39",
102105
"isarray": "npm:@nolyfill/isarray@^1.0.29",
106+
"react": "^19.0.0",
107+
"react-dom": "^19.0.0",
103108
"safe-buffer": "npm:@nolyfill/safe-buffer@^1.0.41",
104109
"safer-buffer": "npm:@nolyfill/safer-buffer@^1.0.41",
105110
"side-channel": "npm:@nolyfill/side-channel@^1.0.29",
106-
"typedarray": "npm:@nolyfill/typedarray@^1.0.29",
107-
"@types/react": "^19.0.1",
108-
"@types/react-dom": "^19.0.2",
109-
"cross-spawn": "7.0.6",
110-
"react": "^19.0.0",
111-
"react-dom": "^19.0.0",
112111
"ts-api-utils": "^2.0.0",
112+
"typedarray": "npm:@nolyfill/typedarray@^1.0.29",
113113
"typescript": "^5.7.2"
114114
}
115115
}

pnpm-lock.yaml

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

website/eslint.config.mjs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import js from "@eslint/js";
22
import tseslint from "typescript-eslint";
3+
import next from "@next/eslint-plugin-next";
34
import react from "@eslint-react/eslint-plugin";
45
import reactHooks from "eslint-plugin-react-hooks";
56
import gitignore from "eslint-config-flat-gitignore";
@@ -29,6 +30,22 @@ export default tseslint.config(
2930
},
3031
rules: reactHooks.configs.recommended.rules,
3132
},
33+
{
34+
files: ["**/*.{ts,tsx}"],
35+
plugins: {
36+
"@next/next": next,
37+
},
38+
rules: {
39+
...next.configs.recommended.rules,
40+
...next.configs["core-web-vitals"].rules,
41+
},
42+
},
43+
{
44+
files: ["app/**/*.{js,ts,jsx,tsx}"],
45+
rules: {
46+
"@typescript-eslint/require-await": "off",
47+
},
48+
},
3249
{
3350
files: ["*.js", "*.cjs"],
3451
...tseslint.configs.disableTypeChecked,

website/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"@eslint/js": "^9.17.0",
2222
"@mdx-js/mdx": "^3.1.0",
2323
"@next/bundle-analyzer": "^15.1.0",
24+
"@next/eslint-plugin-next": "^15.1.0",
2425
"@tsconfig/node22": "^22.0.0",
2526
"@tsconfig/strictest": "^2.0.5",
2627
"@types/node": "^22.10.2",

0 commit comments

Comments
 (0)