Skip to content

Commit c580aee

Browse files
committed
fix cra config
1 parent 40b0731 commit c580aee

File tree

5 files changed

+39
-58
lines changed

5 files changed

+39
-58
lines changed

cypress/package.json

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
"test": "yarn node ./start.js"
88
},
99
"devDependencies": {
10-
"@eslint/eslintrc": "^3.3.1",
11-
"@eslint/js": "^9.23.0",
1210
"cypress": "^10.9.0",
1311
"cypress-plugin-tab": "^1.0.5",
1412
"cypress-vite": "^1.4.0",

package.json

-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
"@babel/preset-env": "^7.26.9",
3535
"@babel/preset-react": "^7.26.3",
3636
"@babel/preset-typescript": "^7.27.0",
37-
"@eslint/compat": "^1.2.7",
38-
"@eslint/eslintrc": "^3.3.1",
3937
"@eslint/js": "^9.23.0",
4038
"@octokit/core": "^6.1.4",
4139
"@storybook/addon-actions": "^8.4.4",
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,44 @@
1+
import js from "@eslint/js";
12
import { defineConfig, globalIgnores } from "eslint/config";
2-
import { fixupConfigRules } from "@eslint/compat";
3+
import tseslint from "typescript-eslint";
4+
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
5+
import react from "eslint-plugin-react";
6+
import reactHooks from "eslint-plugin-react-hooks";
37
import globals from "globals";
4-
import tsParser from "@typescript-eslint/parser";
5-
import path from "node:path";
6-
import { fileURLToPath } from "node:url";
7-
import js from "@eslint/js";
8-
import { FlatCompat } from "@eslint/eslintrc";
9-
10-
const __filename = fileURLToPath(import.meta.url);
11-
const __dirname = path.dirname(__filename);
12-
const compat = new FlatCompat({
13-
baseDirectory: __dirname,
14-
recommendedConfig: js.configs.recommended,
15-
allConfig: js.configs.all
16-
});
17-
18-
export default defineConfig([globalIgnores(["**/node_modules", "**/dist"]), {
19-
extends: fixupConfigRules(compat.extends(
20-
"eslint:recommended",
21-
"plugin:react/recommended",
22-
"plugin:react/jsx-runtime",
23-
"plugin:@typescript-eslint/recommended",
24-
"plugin:react-hooks/recommended",
25-
"prettier",
26-
)),
278

9+
export default defineConfig([
10+
globalIgnores(["**/node_modules", "**/dist"]),
11+
{
12+
name: "eslint-js-recommended-rules",
13+
plugins: {
14+
js,
15+
},
16+
extends: ["js/recommended"],
17+
},
18+
tseslint.configs.recommended.map((conf) => ({
19+
...conf,
20+
files: ["**/*.ts", "**/*.tsx"],
21+
})),
22+
eslintPluginPrettierRecommended,
23+
{
24+
name: "react",
25+
...react.configs.flat.recommended,
26+
},
27+
reactHooks.configs["recommended-latest"],
28+
{
2829
languageOptions: {
29-
globals: {
30-
...globals.browser,
31-
},
32-
33-
parser: tsParser,
30+
globals: {
31+
...globals.browser,
32+
...globals.node,
33+
},
34+
},
35+
rules: {
36+
"react/react-in-jsx-scope": "off",
3437
},
35-
3638
settings: {
37-
react: {
38-
version: "detect",
39-
},
39+
react: {
40+
version: "detect",
41+
},
4042
},
41-
}]);
43+
},
44+
]);

packages/create-react-admin/templates/common/package.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,20 @@
2121
"react-router-dom": "^7.1.3"
2222
},
2323
"devDependencies": {
24-
"@eslint/compat": "^1.2.7",
25-
"@eslint/eslintrc": "^3.3.1",
2624
"@eslint/js": "^9.23.0",
27-
"@typescript-eslint/parser": "^8.28.0",
28-
"@typescript-eslint/eslint-plugin": "^8.28.0",
2925
"@types/node": "^20.10.7",
3026
"@types/react": "^18.3.3",
3127
"@types/react-dom": "^18.3.0",
3228
"@vitejs/plugin-react": "^4.0.1",
3329
"eslint": "^9.23.0",
3430
"eslint-config-prettier": "^10.1.1",
31+
"eslint-plugin-prettier": "^5.2.5",
3532
"eslint-plugin-react": "^7.37.4",
3633
"eslint-plugin-react-hooks": "^5.2.0",
3734
"globals": "^16.0.0",
3835
"prettier": "^3.3.3",
3936
"typescript": "^5.1.6",
37+
"typescript-eslint": "^8.28.0",
4038
"vite": "^5.3.5"
4139
}
4240
}

yarn.lock

-16
Original file line numberDiff line numberDiff line change
@@ -2633,18 +2633,6 @@ __metadata:
26332633
languageName: node
26342634
linkType: hard
26352635

2636-
"@eslint/compat@npm:^1.2.7":
2637-
version: 1.2.7
2638-
resolution: "@eslint/compat@npm:1.2.7"
2639-
peerDependencies:
2640-
eslint: ^9.10.0
2641-
peerDependenciesMeta:
2642-
eslint:
2643-
optional: true
2644-
checksum: df89a0396750748c3748eb5fc582bd6cb89be6599d88ed1c5cc60ae0d13f77d4bf5fb30fabdb6c9ce16dda35745ef2e6417fa82548cde7d2b3fa5a896da02c8e
2645-
languageName: node
2646-
linkType: hard
2647-
26482636
"@eslint/config-array@npm:^0.19.2":
26492637
version: 0.19.2
26502638
resolution: "@eslint/config-array@npm:0.19.2"
@@ -9427,8 +9415,6 @@ __metadata:
94279415
version: 0.0.0-use.local
94289416
resolution: "e2e@workspace:cypress"
94299417
dependencies:
9430-
"@eslint/eslintrc": "npm:^3.3.1"
9431-
"@eslint/js": "npm:^9.23.0"
94329418
cypress: "npm:^10.9.0"
94339419
cypress-plugin-tab: "npm:^1.0.5"
94349420
cypress-vite: "npm:^1.4.0"
@@ -17802,8 +17788,6 @@ __metadata:
1780217788
"@babel/preset-env": "npm:^7.26.9"
1780317789
"@babel/preset-react": "npm:^7.26.3"
1780417790
"@babel/preset-typescript": "npm:^7.27.0"
17805-
"@eslint/compat": "npm:^1.2.7"
17806-
"@eslint/eslintrc": "npm:^3.3.1"
1780717791
"@eslint/js": "npm:^9.23.0"
1780817792
"@octokit/core": "npm:^6.1.4"
1780917793
"@storybook/addon-actions": "npm:^8.4.4"

0 commit comments

Comments
 (0)