Skip to content

Commit daf7676

Browse files
committed
Fix for eslint v9
1 parent 3e9eded commit daf7676

File tree

4 files changed

+114
-10
lines changed

4 files changed

+114
-10
lines changed

.eslintrc.json

-3
This file was deleted.

eslint.config.mjs

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import nextPlugin from "@next/eslint-plugin-next";
2+
import reactPlugin from "eslint-plugin-react";
3+
import hooksPlugin from "eslint-plugin-react-hooks";
4+
import js from "@eslint/js";
5+
// import tseslint from "typescript-eslint";
6+
import eslintConfigPrettier from "eslint-config-prettier";
7+
8+
const config = [
9+
{
10+
files: ["*.js", "*.jsx", "*.ts", "*.tsx"],
11+
},
12+
{
13+
ignores: [
14+
"**/next-env.d.ts",
15+
"**/build/",
16+
"**/bin/",
17+
"**/obj/",
18+
"**/out/",
19+
"**/.next/",
20+
"**/public/",
21+
],
22+
},
23+
{
24+
name: "eslint/recommended",
25+
rules: js.configs.recommended.rules,
26+
},
27+
// ...tseslint.configs.recommended,
28+
{
29+
name: "react/jsx-runtime",
30+
plugins: {
31+
react: reactPlugin,
32+
},
33+
rules: reactPlugin.configs["jsx-runtime"].rules,
34+
settings: {
35+
react: {
36+
version: "detect",
37+
},
38+
},
39+
},
40+
{
41+
name: "react-hooks/recommended",
42+
plugins: {
43+
"react-hooks": hooksPlugin,
44+
},
45+
rules: hooksPlugin.configs.recommended.rules,
46+
},
47+
{
48+
name: "next/core-web-vitals",
49+
plugins: {
50+
"@next/next": nextPlugin,
51+
},
52+
rules: {
53+
...nextPlugin.configs.recommended.rules,
54+
...nextPlugin.configs["core-web-vitals"].rules,
55+
},
56+
},
57+
{
58+
name: "prettier/config",
59+
...eslintConfigPrettier,
60+
},
61+
];
62+
63+
export default config;

package-lock.json

+43-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+8-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"dev": "NODE_OPTIONS=--experimental-wasm-modules next dev",
88
"build": "NODE_OPTIONS=--experimental-wasm-modules next build",
99
"start": "NODE_OPTIONS=--experimental-wasm-modules next start",
10-
"lint": "NODE_OPTIONS=--experimental-wasm-modules next lint",
10+
"lint": "eslint",
1111
"extract": "node --loader ts-node/esm ./scripts/extractExamples.ts",
1212
"test": "jest",
1313
"test:counter": "node --loader ts-node/esm ./tests/counter.ts",
@@ -61,14 +61,18 @@
6161
"@typescript-eslint/eslint-plugin": "^8.0.0",
6262
"@typescript-eslint/parser": "^8.0.0",
6363
"dotenv": "^16.3.1",
64-
"eslint": "^9.0.0",
65-
"eslint-config-next": "15.1.3",
64+
"eslint": "^9.13.0",
65+
"eslint-config-next": "^15.0.1",
66+
"eslint-config-prettier": "^9.1.0",
67+
"eslint-plugin-react": "^7.37.2",
68+
"eslint-plugin-react-hooks": "^5.0.0",
6669
"happy-css-modules": "^3.0.1",
6770
"jest": "^29.7.0",
6871
"next-transpile-modules": "^10.0.1",
6972
"ts-jest": "^29.1.4",
7073
"ts-node": "^10.9.1",
7174
"tsx": "^4.19.2",
72-
"typescript": "5.7.2"
75+
"typescript": "5.7.2",
76+
"typescript-eslint": "^8.18.0"
7377
}
7478
}

0 commit comments

Comments
 (0)