Skip to content

Commit 49e9c16

Browse files
chore: More eslint improvements (#5482)
1 parent f9dce35 commit 49e9c16

File tree

37 files changed

+85
-302
lines changed

37 files changed

+85
-302
lines changed

.eslintrc.cjs

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = {
88
extends: [
99
'plugin:@typescript-eslint/eslint-recommended',
1010
'plugin:@typescript-eslint/recommended',
11+
'plugin:import/recommended',
1112
'plugin:import/typescript',
1213
'prettier',
1314
],
@@ -46,7 +47,10 @@ module.exports = {
4647
'@typescript-eslint/no-inferrable-types': [
4748
'error', { ignoreParameters: true },
4849
],
50+
'import/default': 'off',
51+
'import/export': 'off',
4952
'import/no-cycle': 'error',
53+
'import/no-duplicates': 'off',
5054
'import/no-unresolved': ['error', { ignore: ['^@tanstack/'] }],
5155
'import/no-unused-modules': ['off', { unusedExports: true }],
5256
'no-redeclare': 'off',

examples/react/algolia/.eslintrc

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"extends": ["react-app", "prettier", "plugin:@tanstack/eslint-plugin-query/recommended"],
3-
"rules": {
4-
"react/jsx-uses-react": "off",
5-
"react/react-in-jsx-scope": "off"
6-
}
2+
"extends": [
3+
"plugin:react/recommended",
4+
"plugin:react-hooks/recommended",
5+
"plugin:@tanstack/eslint-plugin-query/recommended"
6+
]
77
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"extends": ["react-app", "prettier"],
3-
"rules": {
4-
// "eqeqeq": 0,
5-
// "jsx-a11y/anchor-is-valid": 0
6-
}
2+
"extends": [
3+
"plugin:react/recommended",
4+
"plugin:react-hooks/recommended"
5+
]
76
}
+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
{
2-
"extends": ["react-app", "prettier", "plugin:@tanstack/eslint-plugin-query/recommended"]
2+
"extends": [
3+
"plugin:react/recommended",
4+
"plugin:react-hooks/recommended",
5+
"plugin:@tanstack/eslint-plugin-query/recommended"
6+
]
37
}

examples/react/basic/.eslintrc

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
{
2-
"extends": ["react-app", "prettier", "plugin:@tanstack/eslint-plugin-query/recommended"]
2+
"extends": [
3+
"plugin:react/recommended",
4+
"plugin:react-hooks/recommended",
5+
"plugin:@tanstack/eslint-plugin-query/recommended"
6+
]
37
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"extends": ["react-app", "prettier"],
3-
"rules": {
4-
// "eqeqeq": 0,
5-
// "jsx-a11y/anchor-is-valid": 0
6-
}
2+
"extends": [
3+
"plugin:react/recommended",
4+
"plugin:react-hooks/recommended"
5+
]
76
}

examples/react/offline/.eslintrc

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"extends": ["react-app", "prettier"],
3-
"rules": {
4-
// "eqeqeq": 0,
5-
// "jsx-a11y/anchor-is-valid": 0
6-
}
2+
"extends": [
3+
"plugin:react/recommended",
4+
"plugin:react-hooks/recommended"
5+
]
76
}

examples/react/playground/.eslintrc

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"extends": ["react-app", "prettier"],
3-
"rules": {
4-
// "eqeqeq": 0,
5-
// "jsx-a11y/anchor-is-valid": 0
6-
}
2+
"extends": [
3+
"plugin:react/recommended",
4+
"plugin:react-hooks/recommended"
5+
]
76
}

examples/react/react-router/.eslintrc

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"extends": ["react-app", "prettier"],
3-
"rules": {
4-
// "eqeqeq": 0,
5-
// "jsx-a11y/anchor-is-valid": 0
6-
}
2+
"extends": [
3+
"plugin:react/recommended",
4+
"plugin:react-hooks/recommended"
5+
]
76
}

examples/react/rick-morty/.eslintrc

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"extends": ["react-app", "prettier"],
3-
"rules": {
4-
// "eqeqeq": 0,
5-
// "jsx-a11y/anchor-is-valid": 0
6-
}
2+
"extends": [
3+
"plugin:react/recommended",
4+
"plugin:react-hooks/recommended"
5+
]
76
}

examples/react/simple/.eslintrc

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"extends": ["react-app", "prettier"],
3-
"rules": {
4-
// "eqeqeq": 0,
5-
// "jsx-a11y/anchor-is-valid": 0
6-
}
2+
"extends": [
3+
"plugin:react/recommended",
4+
"plugin:react-hooks/recommended"
5+
]
76
}

examples/react/star-wars/.eslintrc

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"extends": ["react-app", "prettier"],
3-
"rules": {
4-
// "eqeqeq": 0,
5-
// "jsx-a11y/anchor-is-valid": 0
6-
}
2+
"extends": [
3+
"plugin:react/recommended",
4+
"plugin:react-hooks/recommended"
5+
]
76
}

examples/react/suspense/.eslintrc

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"extends": ["react-app", "prettier"],
3-
"rules": {
4-
// "eqeqeq": 0,
5-
// "jsx-a11y/anchor-is-valid": 0
6-
}
2+
"extends": [
3+
"plugin:react/recommended",
4+
"plugin:react-hooks/recommended"
5+
]
76
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
{
22
"parserOptions": {
3-
"project": "./tsconfig.json",
4-
"sourceType": "module"
5-
},
6-
"rules": {
7-
"react/react-in-jsx-scope": "off",
8-
"jsx-a11y/anchor-is-valid": "off"
3+
"project": "./tsconfig.json"
94
}
105
}
+1-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
{
22
"parserOptions": {
3-
"project": "./tsconfig.json",
4-
"sourceType": "module"
5-
},
6-
"rules": {
7-
"react/react-in-jsx-scope": "off",
8-
"jsx-a11y/anchor-is-valid": "off"
3+
"project": "./tsconfig.json"
94
}
105
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
{
22
"parserOptions": {
3-
"project": "./tsconfig.json",
4-
"sourceType": "module"
5-
},
6-
"rules": {
7-
"react/react-in-jsx-scope": "off",
8-
"jsx-a11y/anchor-is-valid": "off"
3+
"project": "./tsconfig.json"
94
}
105
}

examples/solid/simple/.eslintrc

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
{
22
"extends": ["plugin:@tanstack/eslint-plugin-query/recommended"],
33
"parserOptions": {
4-
"project": "./tsconfig.json",
5-
"sourceType": "module"
6-
},
7-
"rules": {
8-
"react/react-in-jsx-scope": "off",
9-
"jsx-a11y/accessible-emoji": "off",
4+
"project": "./tsconfig.json"
105
}
116
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
2-
"extends": ["../../../.eslintrc"],
3-
"rules": {
4-
"react/react-in-jsx-scope": "off",
5-
"import/no-unresolved": "off"
2+
"parserOptions": {
3+
"project": "./tsconfig.json"
64
}
75
}

nx.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"{workspaceRoot}/tsconfig.base.json",
3232
"{workspaceRoot}/package.json"
3333
],
34-
"globalNonBuildAffectingConfig": ["{workspaceRoot}/.eslintrc"],
34+
"globalNonBuildAffectingConfig": ["{workspaceRoot}/.eslintrc.cjs"],
3535
"default": [
3636
"{projectRoot}/**/*",
3737
"globalBuildAffectingConfig",
@@ -41,9 +41,9 @@
4141
],
4242
"public": [
4343
"default",
44-
"!{workspaceRoot}/.eslintrc",
44+
"!{workspaceRoot}/.eslintrc.cjs",
4545
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
46-
"!{projectRoot}/.eslintrc*",
46+
"!{projectRoot}/.eslintrc.cjs",
4747
"!{projectRoot}/tsconfig.eslint.json"
4848
]
4949
},

package.json

-4
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,8 @@
6565
"current-git-branch": "^1.1.0",
6666
"eslint": "^8.34.0",
6767
"eslint-config-prettier": "^8.8.0",
68-
"eslint-config-react-app": "^7.0.1",
6968
"eslint-import-resolver-typescript": "^3.5.5",
7069
"eslint-plugin-import": "^2.27.5",
71-
"eslint-plugin-jsx-a11y": "^6.7.1",
72-
"eslint-plugin-prettier": "^4.2.1",
73-
"eslint-plugin-promise": "^6.1.1",
7470
"eslint-plugin-react": "^7.32.2",
7571
"eslint-plugin-react-hooks": "^4.6.0",
7672
"git-log-parser": "^1.2.0",

packages/codemods/.eslintrc.cjs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
/** @type {import('eslint').Linter.Config} */
44
const config = {
5-
root: true,
6-
extends: ['../../.eslintrc.cjs'],
75
parserOptions: {
86
tsconfigRootDir: __dirname,
97
project: './tsconfig.eslint.json',

packages/eslint-plugin-query/.eslintrc.cjs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
/** @type {import('eslint').Linter.Config} */
44
const config = {
5-
root: true,
6-
extends: ['../../.eslintrc.cjs'],
75
parserOptions: {
86
tsconfigRootDir: __dirname,
97
project: './tsconfig.eslint.json',

packages/query-async-storage-persister/.eslintrc.cjs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
/** @type {import('eslint').Linter.Config} */
44
const config = {
5-
root: true,
6-
extends: ['../../.eslintrc.cjs'],
75
parserOptions: {
86
tsconfigRootDir: __dirname,
97
project: './tsconfig.eslint.json',

packages/query-broadcast-client-experimental/.eslintrc.cjs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
/** @type {import('eslint').Linter.Config} */
44
const config = {
5-
root: true,
6-
extends: ['../../.eslintrc.cjs'],
75
parserOptions: {
86
tsconfigRootDir: __dirname,
97
project: './tsconfig.eslint.json',

packages/query-core/.eslintrc.cjs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
/** @type {import('eslint').Linter.Config} */
44
const config = {
5-
root: true,
6-
extends: ['../../.eslintrc.cjs'],
75
parserOptions: {
86
tsconfigRootDir: __dirname,
97
project: './tsconfig.eslint.json',

packages/query-devtools/.eslintrc.cjs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
/** @type {import('eslint').Linter.Config} */
44
const config = {
5-
root: true,
6-
extends: ['../../.eslintrc.cjs'],
75
parserOptions: {
86
tsconfigRootDir: __dirname,
97
project: './tsconfig.eslint.json',

packages/query-persist-client-core/.eslintrc.cjs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
/** @type {import('eslint').Linter.Config} */
44
const config = {
5-
root: true,
6-
extends: ['../../.eslintrc.cjs'],
75
parserOptions: {
86
tsconfigRootDir: __dirname,
97
project: './tsconfig.eslint.json',

packages/query-sync-storage-persister/.eslintrc.cjs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
/** @type {import('eslint').Linter.Config} */
44
const config = {
5-
root: true,
6-
extends: ['../../.eslintrc.cjs'],
75
parserOptions: {
86
tsconfigRootDir: __dirname,
97
project: './tsconfig.eslint.json',

packages/react-query-devtools/.eslintrc.cjs

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
/** @type {import('eslint').Linter.Config} */
44
const config = {
5-
root: true,
6-
extends: ['../../.eslintrc.cjs', 'react-app',],
5+
extends: [
6+
'plugin:react/recommended',
7+
'plugin:react-hooks/recommended',
8+
],
79
parserOptions: {
810
tsconfigRootDir: __dirname,
911
project: './tsconfig.eslint.json',

packages/react-query-persist-client/.eslintrc.cjs

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
/** @type {import('eslint').Linter.Config} */
44
const config = {
5-
root: true,
6-
extends: ['../../.eslintrc.cjs', 'react-app',],
5+
extends: [
6+
'plugin:react/recommended',
7+
'plugin:react-hooks/recommended',
8+
],
79
parserOptions: {
810
tsconfigRootDir: __dirname,
911
project: './tsconfig.eslint.json',

packages/react-query/.eslintrc.cjs

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
/** @type {import('eslint').Linter.Config} */
44
const config = {
5-
root: true,
6-
extends: ['../../.eslintrc.cjs', 'react-app',],
5+
extends: [
6+
'plugin:react/recommended',
7+
'plugin:react-hooks/recommended',
8+
],
79
parserOptions: {
810
tsconfigRootDir: __dirname,
911
project: './tsconfig.eslint.json',

packages/solid-query/.eslintrc.cjs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
/** @type {import('eslint').Linter.Config} */
44
const config = {
5-
root: true,
6-
extends: ['../../.eslintrc.cjs'],
75
parserOptions: {
86
tsconfigRootDir: __dirname,
97
project: './tsconfig.eslint.json',

packages/svelte-query-devtools/.eslintrc.cjs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
/** @type {import('eslint').Linter.Config} */
44
const config = {
5-
root: true,
6-
extends: ['../../.eslintrc.cjs', 'plugin:svelte/recommended'],
5+
extends: ['plugin:svelte/recommended'],
76
parserOptions: {
87
tsconfigRootDir: __dirname,
98
project: './tsconfig.json',

packages/svelte-query/.eslintrc.cjs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
/** @type {import('eslint').Linter.Config} */
44
const config = {
5-
root: true,
6-
extends: ['../../.eslintrc.cjs', 'plugin:svelte/recommended'],
5+
extends: ['plugin:svelte/recommended'],
76
parserOptions: {
87
tsconfigRootDir: __dirname,
98
project: './tsconfig.json',

packages/vue-query/.eslintrc.cjs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
/** @type {import('eslint').Linter.Config} */
44
const config = {
5-
root: true,
6-
extends: ['../../.eslintrc.cjs'],
75
parserOptions: {
86
tsconfigRootDir: __dirname,
97
project: './tsconfig.eslint.json',

0 commit comments

Comments
 (0)