Skip to content

Commit 9d028c1

Browse files
committed
chore: update to eslint-plugin-react-hooks v6
and remove the separate compiler linter plugin, as those rules are now integrated
1 parent b63a1d0 commit 9d028c1

File tree

12 files changed

+65
-93
lines changed

12 files changed

+65
-93
lines changed

.github/renovate.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"@types/node",
2121
"@types/react",
2222
"@types/react-dom",
23-
"eslint-plugin-react-compiler",
2423
"node",
2524
"react",
2625
"react-dom",

examples/react/algolia/eslint.config.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
import { tanstackConfig } from '@tanstack/config/eslint'
22
import pluginQuery from '@tanstack/eslint-plugin-query'
33
import pluginReact from '@eslint-react/eslint-plugin'
4-
import pluginReactHooks from 'eslint-plugin-react-hooks'
4+
import * as reactHooks from 'eslint-plugin-react-hooks'
55

66
export default [
77
...tanstackConfig,
88
...pluginQuery.configs['flat/recommended'],
99
pluginReact.configs.recommended,
10+
reactHooks.configs.recommended,
1011
{
11-
plugins: {
12-
'react-hooks': pluginReactHooks,
13-
},
1412
rules: {
1513
'react-hooks/exhaustive-deps': 'error',
1614
'react-hooks/rules-of-hooks': 'error',

examples/react/basic-graphql-request/eslint.config.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
import { tanstackConfig } from '@tanstack/config/eslint'
22
import pluginQuery from '@tanstack/eslint-plugin-query'
33
import pluginReact from '@eslint-react/eslint-plugin'
4-
import pluginReactHooks from 'eslint-plugin-react-hooks'
4+
import * as reactHooks from 'eslint-plugin-react-hooks'
55

66
export default [
77
...tanstackConfig,
88
...pluginQuery.configs['flat/recommended'],
99
pluginReact.configs.recommended,
10+
reactHooks.configs.recommended,
1011
{
11-
plugins: {
12-
'react-hooks': pluginReactHooks,
13-
},
1412
rules: {
1513
'react-hooks/exhaustive-deps': 'error',
1614
'react-hooks/rules-of-hooks': 'error',

examples/react/basic/eslint.config.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
import { tanstackConfig } from '@tanstack/config/eslint'
22
import pluginQuery from '@tanstack/eslint-plugin-query'
33
import pluginReact from '@eslint-react/eslint-plugin'
4-
import pluginReactHooks from 'eslint-plugin-react-hooks'
4+
import * as reactHooks from 'eslint-plugin-react-hooks'
55

66
export default [
77
...tanstackConfig,
88
...pluginQuery.configs['flat/recommended'],
99
pluginReact.configs.recommended,
10+
reactHooks.configs.recommended,
1011
{
11-
plugins: {
12-
'react-hooks': pluginReactHooks,
13-
},
1412
rules: {
1513
'react-hooks/exhaustive-deps': 'error',
1614
'react-hooks/rules-of-hooks': 'error',

examples/react/shadow-dom/eslint.config.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
import { tanstackConfig } from '@tanstack/config/eslint'
22
import pluginQuery from '@tanstack/eslint-plugin-query'
33
import pluginReact from '@eslint-react/eslint-plugin'
4-
import pluginReactHooks from 'eslint-plugin-react-hooks'
4+
import * as reactHooks from 'eslint-plugin-react-hooks'
55

66
export default [
77
...tanstackConfig,
88
...pluginQuery.configs['flat/recommended'],
99
pluginReact.configs.recommended,
10+
reactHooks.configs.recommended,
1011
{
11-
plugins: {
12-
'react-hooks': pluginReactHooks,
13-
},
1412
rules: {
1513
'react-hooks/exhaustive-deps': 'error',
1614
'react-hooks/rules-of-hooks': 'error',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"cpy-cli": "^5.0.0",
5151
"esbuild-plugin-file-path-extensions": "^2.1.4",
5252
"eslint": "^9.15.0",
53-
"eslint-plugin-react-hooks": "^5.2.0",
53+
"eslint-plugin-react-hooks": "6.0.0-rc.1",
5454
"jsdom": "^25.0.1",
5555
"knip": "^5.50.2",
5656
"nx": "20.7.2",
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
// @ts-check
22

33
import pluginReact from '@eslint-react/eslint-plugin'
4-
import pluginReactHooks from 'eslint-plugin-react-hooks'
4+
import * as reactHooks from 'eslint-plugin-react-hooks'
55
import rootConfig from './root.eslint.config.js'
66

77
export default [
88
...rootConfig,
9+
reactHooks.configs.recommended,
910
{
1011
files: ['**/*.{ts,tsx}'],
1112
...pluginReact.configs.recommended,
1213
},
1314
{
14-
plugins: {
15-
'react-hooks': pluginReactHooks,
16-
},
1715
rules: {
1816
'react-hooks/exhaustive-deps': 'error',
1917
'react-hooks/rules-of-hooks': 'error',
18+
'react-hooks/react-compiler': 'error',
2019
},
2120
},
2221
]
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
// @ts-check
22

33
import pluginReact from '@eslint-react/eslint-plugin'
4-
import pluginReactHooks from 'eslint-plugin-react-hooks'
4+
import * as reactHooks from 'eslint-plugin-react-hooks'
55
import rootConfig from './root.eslint.config.js'
66

77
export default [
88
...rootConfig,
9+
reactHooks.configs.recommended,
910
{
1011
files: ['**/*.{ts,tsx}'],
1112
...pluginReact.configs.recommended,
1213
},
1314
{
14-
plugins: {
15-
'react-hooks': pluginReactHooks,
16-
},
1715
rules: {
1816
'@eslint-react/no-unstable-context-value': 'off',
1917
'react-hooks/exhaustive-deps': 'error',
2018
'react-hooks/rules-of-hooks': 'error',
19+
'react-hooks/react-compiler': 'error',
2120
},
2221
},
2322
]
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
// @ts-check
22

33
import pluginReact from '@eslint-react/eslint-plugin'
4-
import pluginReactHooks from 'eslint-plugin-react-hooks'
4+
import * as reactHooks from 'eslint-plugin-react-hooks'
55
import rootConfig from './root.eslint.config.js'
66

77
export default [
88
...rootConfig,
9+
reactHooks.configs.recommended,
910
{
1011
files: ['**/*.{ts,tsx}'],
1112
...pluginReact.configs.recommended,
1213
},
1314
{
14-
plugins: {
15-
'react-hooks': pluginReactHooks,
16-
},
1715
rules: {
1816
'react-hooks/exhaustive-deps': 'error',
1917
'react-hooks/rules-of-hooks': 'error',
18+
'react-hooks/react-compiler': 'error',
2019
},
2120
},
2221
]

packages/react-query/eslint.config.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
11
// @ts-check
22

33
import pluginReact from '@eslint-react/eslint-plugin'
4-
// @ts-expect-error
5-
import pluginReactCompiler from 'eslint-plugin-react-compiler'
6-
import pluginReactHooks from 'eslint-plugin-react-hooks'
4+
import * as reactHooks from 'eslint-plugin-react-hooks'
75
import rootConfig from './root.eslint.config.js'
86

97
export default [
108
...rootConfig,
9+
reactHooks.configs.recommended,
1110
{
1211
files: ['**/*.{ts,tsx}'],
1312
...pluginReact.configs.recommended,
1413
},
1514
{
16-
plugins: {
17-
'react-hooks': pluginReactHooks,
18-
'react-compiler': pluginReactCompiler,
19-
},
2015
rules: {
2116
'@eslint-react/dom/no-missing-button-type': 'off',
22-
'react-compiler/react-compiler': 'error',
17+
'react-hooks/react-compiler': 'error',
2318
'react-hooks/exhaustive-deps': 'error',
2419
'react-hooks/rules-of-hooks': 'error',
2520
},
@@ -28,7 +23,6 @@ export default [
2823
files: ['**/__tests__/**'],
2924
rules: {
3025
'@typescript-eslint/no-unnecessary-condition': 'off',
31-
'react-compiler/react-compiler': 'off',
3226
},
3327
},
3428
]

packages/react-query/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
"@types/react": "^19.0.1",
7474
"@types/react-dom": "^19.0.2",
7575
"@vitejs/plugin-react": "^4.3.4",
76-
"eslint-plugin-react-compiler": "19.0.0-beta-df7b47d-20241124",
7776
"npm-run-all2": "^5.0.0",
7877
"react": "^19.0.0",
7978
"react-dom": "^19.0.0",

0 commit comments

Comments
 (0)