Skip to content

Commit 3f14e4a

Browse files
committed
Use the shareable ESLint config
1 parent a7586d3 commit 3f14e4a

File tree

35 files changed

+248
-836
lines changed

35 files changed

+248
-836
lines changed

.eslintrc.js

Lines changed: 0 additions & 61 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,6 @@ tsconfig.vitest-temp.json
3535

3636
# node version manager files
3737
.node-version
38-
.nvmrc
38+
.nvmrc
39+
40+
.eslintcache

eslint.config.mts

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
import { createESLintConfig } from '@reduxjs/eslint-config'
2+
import eslintConfigPackageJson from '@reduxjs/eslint-config/package.json' with { type: 'json' }
3+
4+
const basename = `${eslintConfigPackageJson.name}/overrides`
5+
6+
const eslintConfig = createESLintConfig([
7+
{
8+
name: `${basename}/global-ignores`,
9+
ignores: [
10+
'packages/rtk-codemods/transforms/*/__testfixtures__/',
11+
'packages/toolkit/.size-limit.cjs',
12+
'packages/rtk-query-codegen-openapi/lib/',
13+
'packages/rtk-query-codegen-openapi/test/config.example.js',
14+
'examples/publish-ci/',
15+
16+
// TODO: Remove this later.
17+
'examples/',
18+
],
19+
},
20+
21+
{
22+
name: `${basename}/main`,
23+
files: ['**/*.?(c|m)[jt]s?(x)'],
24+
languageOptions: {
25+
parserOptions: {
26+
projectService: true,
27+
tsconfigRootDir: import.meta.dirname,
28+
},
29+
},
30+
rules: {
31+
// TODO: Enable this later.
32+
'@typescript-eslint/consistent-type-definitions': [0, 'type'],
33+
'@typescript-eslint/prefer-nullish-coalescing': [0],
34+
'@typescript-eslint/no-namespace': [0],
35+
'@typescript-eslint/require-await': [0],
36+
'@typescript-eslint/unified-signatures': [0],
37+
'@typescript-eslint/no-unnecessary-type-parameters': [0],
38+
'@typescript-eslint/no-invalid-void-type': [0],
39+
'@typescript-eslint/no-unnecessary-type-arguments': [0],
40+
'@typescript-eslint/no-confusing-void-expression': [0],
41+
'@typescript-eslint/no-duplicate-type-constituents': [0],
42+
'@typescript-eslint/no-redundant-type-constituents': [0],
43+
'@typescript-eslint/no-unnecessary-type-assertion': [0],
44+
'object-shorthand': [0],
45+
'@typescript-eslint/no-explicit-any': [
46+
0,
47+
{
48+
fixToUnknown: false,
49+
ignoreRestArgs: false,
50+
},
51+
],
52+
},
53+
},
54+
55+
{
56+
name: `${basename}/vitest-custom-matchers-declaration-file`,
57+
files: ['packages/toolkit/src/tests/utils/CustomMatchers.d.ts'],
58+
rules: {
59+
'@typescript-eslint/no-empty-object-type': [
60+
2,
61+
{
62+
allowInterfaces: 'with-single-extends',
63+
allowObjectTypes: 'never',
64+
},
65+
],
66+
},
67+
},
68+
69+
{
70+
name: `${basename}/no-require-imports`,
71+
files: ['examples/query/react/graphql-codegen/src/mocks/schema.js'],
72+
languageOptions: {
73+
sourceType: 'commonjs',
74+
},
75+
rules: {
76+
'@typescript-eslint/no-require-imports': [
77+
2,
78+
{
79+
allow: ['ts-node', '\\./db(.c?[tj]s)?$'],
80+
allowAsImport: false,
81+
},
82+
],
83+
},
84+
},
85+
86+
{
87+
name: `${basename}/examples/type-portability/nodenext-cjs`,
88+
files: ['examples/type-portability/nodenext-cjs/**/*.?(c)ts?(x)'],
89+
languageOptions: {
90+
sourceType: 'commonjs',
91+
},
92+
rules: {
93+
'@typescript-eslint/no-namespace': [
94+
0,
95+
{
96+
allowDeclarations: false,
97+
allowDefinitionFiles: true,
98+
},
99+
],
100+
},
101+
},
102+
])
103+
104+
export default eslintConfig

examples/action-listener/counter/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"react-dom": "^19.0.0",
1313
"react-redux": "^9.1.2",
1414
"react-scripts": "5.0.1",
15-
"typescript": "^5.8.2"
15+
"typescript": "^5.9.3"
1616
},
1717
"scripts": {
1818
"start": "react-scripts start",

examples/query/react/advanced/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"devDependencies": {
1616
"@types/react": "^19.0.1",
1717
"@types/react-dom": "^19.0.1",
18-
"typescript": "^5.8.2"
18+
"typescript": "^5.9.3"
1919
},
2020
"eslintConfig": {
2121
"extends": [

examples/query/react/authentication-with-extrareducers/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"devDependencies": {
2323
"@types/react": "^19.0.1",
2424
"@types/react-dom": "^19.0.1",
25-
"typescript": "^5.8.2"
25+
"typescript": "^5.9.3"
2626
},
2727
"scripts": {
2828
"start": "react-scripts start",

examples/query/react/authentication/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"devDependencies": {
2323
"@types/react": "^19.0.1",
2424
"@types/react-dom": "^19.0.1",
25-
"typescript": "^5.8.2"
25+
"typescript": "^5.9.3"
2626
},
2727
"scripts": {
2828
"start": "react-scripts start",

examples/query/react/basic/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@types/react": "^19.0.1",
2020
"@types/react-dom": "^19.0.1",
2121
"msw": "^0.40.2",
22-
"typescript": "^5.8.2"
22+
"typescript": "^5.9.3"
2323
},
2424
"eslintConfig": {
2525
"extends": [

examples/query/react/conditional-fetching/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"devDependencies": {
1616
"@types/react": "^19.0.1",
1717
"@types/react-dom": "^19.0.1",
18-
"typescript": "^5.8.2"
18+
"typescript": "^5.9.3"
1919
},
2020
"eslintConfig": {
2121
"extends": [

examples/query/react/deduping-queries/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"devDependencies": {
1616
"@types/react": "^19.0.1",
1717
"@types/react-dom": "^19.0.1",
18-
"typescript": "^5.8.2"
18+
"typescript": "^5.9.3"
1919
},
2020
"eslintConfig": {
2121
"extends": [

0 commit comments

Comments
 (0)