Skip to content

Commit e2c4276

Browse files
committed
Use the shareable ESLint config
1 parent 5c9200d commit e2c4276

10 files changed

+73
-728
lines changed

.eslintrc.js

-61
This file was deleted.

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ typesversions
3131
.pnp.*
3232
*.tgz
3333

34-
tsconfig.vitest-temp.json
34+
tsconfig.vitest-temp.json
35+
.eslintcache

eslint.config.mts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { createESLintConfig } from '@reduxjs/eslint-config'
2+
import { configs } from 'typescript-eslint'
3+
4+
export default createESLintConfig([
5+
{ name: 'root-workspace/global-ignores', ignores: ['**/'] },
6+
configs.disableTypeChecked,
7+
])

package.json

+7-12
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,12 @@
3131
"@babel/helper-compilation-targets": "^7.23.6",
3232
"@babel/traverse": "^7.24.1",
3333
"@babel/types": "^7.24.0",
34+
"@reduxjs/eslint-config": "workspace:^",
3435
"@reduxjs/prettier-config": "workspace:^",
3536
"@types/react": "^19.0.1",
3637
"@types/react-dom": "^19.0.1",
37-
"@typescript-eslint/eslint-plugin": "6.12.0",
38-
"@typescript-eslint/parser": "6.12.0",
39-
"eslint": "^7.25.0",
40-
"eslint-config-prettier": "^9.1.0",
41-
"eslint-config-react-app": "^7.0.1",
42-
"eslint-plugin-flowtype": "^5.7.2",
43-
"eslint-plugin-import": "^2.22.1",
44-
"eslint-plugin-jsx-a11y": "^6.4.1",
45-
"eslint-plugin-prettier": "^5.1.3",
46-
"eslint-plugin-react": "^7.23.2",
47-
"eslint-plugin-react-hooks": "^4.2.0",
38+
"eslint": "^9.17.0",
39+
"jiti": "^2.4.2",
4840
"netlify-plugin-cache": "^1.0.3",
4941
"prettier": "^3.2.5",
5042
"react": "^19.0.0",
@@ -53,13 +45,16 @@
5345
"release-it": "^14.12.5",
5446
"serve": "^14.2.0",
5547
"ts-node": "^10.9.2",
56-
"typescript": "^5.5.4"
48+
"typescript": "^5.5.4",
49+
"typescript-eslint": "^8.19.0"
5750
},
5851
"scripts": {
5952
"build": "yarn build:packages",
6053
"test": "yarn test:packages",
6154
"format": "prettier --write .",
6255
"format-check": "prettier --check .",
56+
"lint": "eslint --flag unstable_ts_config -c eslint.config.mts",
57+
"lint-fix": "eslint --flag unstable_ts_config -c eslint.config.mts --fix",
6358
"install": "yarn build-configs",
6459
"build-configs": "yarn workspaces foreach -Atip --include '@reduxjs/*config' run build",
6560
"build:examples": "yarn workspaces foreach -A --include '@reduxjs/*' --include '@examples-query-react/*' --include '@examples-action-listener/*' -vtp run build",

packages/rtk-codemods/.eslintrc.json

-11
This file was deleted.
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { createESLintConfig } from '@reduxjs/eslint-config'
2+
3+
export default createESLintConfig([
4+
{ ignores: ['**/__testfixtures__/'] },
5+
{ rules: { '@typescript-eslint/array-type': [0] } }
6+
])

packages/rtk-codemods/package.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"scripts": {
55
"format": "prettier --config prettier.config.mjs --write .",
66
"format-check": "prettier --config prettier.config.mjs --check .",
7-
"lint": "eslint .",
7+
"lint": "eslint --flag unstable_ts_config -c eslint.config.mts",
8+
"lint-fix": "eslint --flag unstable_ts_config -c eslint.config.mts --fix",
89
"test": "vitest --run",
910
"test:watch": "vitest --watch",
1011
"test:coverage": "vitest --coverage"
@@ -31,13 +32,11 @@
3132
"typescript": "^5.3.3"
3233
},
3334
"devDependencies": {
35+
"@reduxjs/eslint-config": "workspace:^",
3436
"@reduxjs/prettier-config": "workspace:^",
3537
"@types/jscodeshift": "^0.11.11",
36-
"@typescript-eslint/parser": "^6.19.1",
37-
"eslint": "^8.56.0",
38-
"eslint-config-prettier": "^9.1.0",
39-
"eslint-plugin-node": "^11.1.0",
40-
"eslint-plugin-prettier": "^5.1.3",
38+
"eslint": "^9.17.0",
39+
"jiti": "^2.4.2",
4140
"prettier": "^3.2.5",
4241
"vitest": "^1.6.0"
4342
},

packages/toolkit/eslint.config.mts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { createESLintConfig } from '@reduxjs/eslint-config'
2+
3+
export default createESLintConfig()

packages/toolkit/package.json

+5-12
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"@babel/helper-module-imports": "^7.24.7",
5555
"@microsoft/api-extractor": "^7.13.2",
5656
"@phryneas/ts-version": "^1.0.2",
57+
"@reduxjs/eslint-config": "workspace:^",
5758
"@reduxjs/prettier-config": "workspace:^",
5859
"@size-limit/file": "^11.0.1",
5960
"@size-limit/webpack": "^11.0.1",
@@ -69,22 +70,13 @@
6970
"@types/react": "^19.0.1",
7071
"@types/react-dom": "^19.0.1",
7172
"@types/yargs": "^16.0.1",
72-
"@typescript-eslint/eslint-plugin": "^6",
73-
"@typescript-eslint/parser": "^6",
7473
"axios": "^0.19.2",
7574
"esbuild": "^0.23.0",
7675
"esbuild-extra": "^0.4.0",
77-
"eslint": "^7.25.0",
78-
"eslint-config-prettier": "^9.1.0",
79-
"eslint-config-react-app": "^7.0.1",
80-
"eslint-plugin-flowtype": "^5.7.2",
81-
"eslint-plugin-import": "^2.22.1",
82-
"eslint-plugin-jsx-a11y": "^6.4.1",
83-
"eslint-plugin-prettier": "^5.1.3",
84-
"eslint-plugin-react": "^7.23.2",
85-
"eslint-plugin-react-hooks": "^4.2.0",
76+
"eslint": "^9.17.0",
8677
"fs-extra": "^9.1.0",
8778
"invariant": "^2.2.4",
79+
"jiti": "^2.4.2",
8880
"jsdom": "^25.0.1",
8981
"json-stringify-safe": "^5.0.1",
9082
"msw": "^2.1.4",
@@ -110,7 +102,8 @@
110102
"build-only": "yarn clean && yarn run-build",
111103
"format": "prettier --config prettier.config.mjs --write .",
112104
"format-check": "prettier --config prettier.config.mjs --check .",
113-
"lint": "eslint src examples",
105+
"lint": "eslint --flag unstable_ts_config -c eslint.config.mts",
106+
"lint-fix": "eslint --flag unstable_ts_config -c eslint.config.mts --fix",
114107
"test": "vitest --typecheck --run ",
115108
"test:watch": "vitest --watch",
116109
"type-tests": "yarn tsc -p tsconfig.test.json --noEmit",

0 commit comments

Comments
 (0)