Skip to content

chore: update to eslint-plugin-react-hooks v6 #9071

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
@@ -20,7 +20,6 @@
"@types/node",
"@types/react",
"@types/react-dom",
"eslint-plugin-react-compiler",
"node",
"react",
"react-dom",
6 changes: 2 additions & 4 deletions examples/react/algolia/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { tanstackConfig } from '@tanstack/config/eslint'
import pluginQuery from '@tanstack/eslint-plugin-query'
import pluginReact from '@eslint-react/eslint-plugin'
import pluginReactHooks from 'eslint-plugin-react-hooks'
import * as reactHooks from 'eslint-plugin-react-hooks'

export default [
...tanstackConfig,
...pluginQuery.configs['flat/recommended'],
pluginReact.configs.recommended,
reactHooks.configs.recommended,
{
plugins: {
'react-hooks': pluginReactHooks,
},
rules: {
'react-hooks/exhaustive-deps': 'error',
'react-hooks/rules-of-hooks': 'error',
6 changes: 2 additions & 4 deletions examples/react/basic-graphql-request/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { tanstackConfig } from '@tanstack/config/eslint'
import pluginQuery from '@tanstack/eslint-plugin-query'
import pluginReact from '@eslint-react/eslint-plugin'
import pluginReactHooks from 'eslint-plugin-react-hooks'
import * as reactHooks from 'eslint-plugin-react-hooks'

export default [
...tanstackConfig,
...pluginQuery.configs['flat/recommended'],
pluginReact.configs.recommended,
reactHooks.configs.recommended,
{
plugins: {
'react-hooks': pluginReactHooks,
},
rules: {
'react-hooks/exhaustive-deps': 'error',
'react-hooks/rules-of-hooks': 'error',
6 changes: 2 additions & 4 deletions examples/react/basic/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { tanstackConfig } from '@tanstack/config/eslint'
import pluginQuery from '@tanstack/eslint-plugin-query'
import pluginReact from '@eslint-react/eslint-plugin'
import pluginReactHooks from 'eslint-plugin-react-hooks'
import * as reactHooks from 'eslint-plugin-react-hooks'

export default [
...tanstackConfig,
...pluginQuery.configs['flat/recommended'],
pluginReact.configs.recommended,
reactHooks.configs.recommended,
{
plugins: {
'react-hooks': pluginReactHooks,
},
rules: {
'react-hooks/exhaustive-deps': 'error',
'react-hooks/rules-of-hooks': 'error',
6 changes: 2 additions & 4 deletions examples/react/shadow-dom/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { tanstackConfig } from '@tanstack/config/eslint'
import pluginQuery from '@tanstack/eslint-plugin-query'
import pluginReact from '@eslint-react/eslint-plugin'
import pluginReactHooks from 'eslint-plugin-react-hooks'
import * as reactHooks from 'eslint-plugin-react-hooks'

export default [
...tanstackConfig,
...pluginQuery.configs['flat/recommended'],
pluginReact.configs.recommended,
reactHooks.configs.recommended,
{
plugins: {
'react-hooks': pluginReactHooks,
},
rules: {
'react-hooks/exhaustive-deps': 'error',
'react-hooks/rules-of-hooks': 'error',
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@
"cpy-cli": "^5.0.0",
"esbuild-plugin-file-path-extensions": "^2.1.4",
"eslint": "^9.15.0",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-hooks": "6.0.0-rc.1",
"jsdom": "^25.0.1",
"knip": "^5.50.2",
"nx": "20.7.2",
7 changes: 3 additions & 4 deletions packages/react-query-devtools/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
// @ts-check

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

export default [
...rootConfig,
reactHooks.configs.recommended,
{
files: ['**/*.{ts,tsx}'],
...pluginReact.configs.recommended,
},
{
plugins: {
'react-hooks': pluginReactHooks,
},
rules: {
'react-hooks/exhaustive-deps': 'error',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/react-compiler': 'error',
},
},
]
7 changes: 3 additions & 4 deletions packages/react-query-next-experimental/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
// @ts-check

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

export default [
...rootConfig,
reactHooks.configs.recommended,
{
files: ['**/*.{ts,tsx}'],
...pluginReact.configs.recommended,
},
{
plugins: {
'react-hooks': pluginReactHooks,
},
rules: {
'@eslint-react/no-unstable-context-value': 'off',
'react-hooks/exhaustive-deps': 'error',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/react-compiler': 'error',
},
},
]
7 changes: 3 additions & 4 deletions packages/react-query-persist-client/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
// @ts-check

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

export default [
...rootConfig,
reactHooks.configs.recommended,
{
files: ['**/*.{ts,tsx}'],
...pluginReact.configs.recommended,
},
{
plugins: {
'react-hooks': pluginReactHooks,
},
rules: {
'react-hooks/exhaustive-deps': 'error',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/react-compiler': 'error',
},
},
]
12 changes: 3 additions & 9 deletions packages/react-query/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
// @ts-check

import pluginReact from '@eslint-react/eslint-plugin'
// @ts-expect-error
import pluginReactCompiler from 'eslint-plugin-react-compiler'
import pluginReactHooks from 'eslint-plugin-react-hooks'
import * as reactHooks from 'eslint-plugin-react-hooks'
import rootConfig from './root.eslint.config.js'

export default [
...rootConfig,
reactHooks.configs.recommended,
{
files: ['**/*.{ts,tsx}'],
...pluginReact.configs.recommended,
},
{
plugins: {
'react-hooks': pluginReactHooks,
'react-compiler': pluginReactCompiler,
},
rules: {
'@eslint-react/dom/no-missing-button-type': 'off',
'react-compiler/react-compiler': 'error',
'react-hooks/react-compiler': 'error',
'react-hooks/exhaustive-deps': 'error',
'react-hooks/rules-of-hooks': 'error',
},
@@ -28,7 +23,6 @@ export default [
files: ['**/__tests__/**'],
rules: {
'@typescript-eslint/no-unnecessary-condition': 'off',
'react-compiler/react-compiler': 'off',
},
},
]
1 change: 0 additions & 1 deletion packages/react-query/package.json
Original file line number Diff line number Diff line change
@@ -73,7 +73,6 @@
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"@vitejs/plugin-react": "^4.3.4",
"eslint-plugin-react-compiler": "19.0.0-beta-df7b47d-20241124",
"npm-run-all2": "^5.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
97 changes: 44 additions & 53 deletions pnpm-lock.yaml

Large diffs are not rendered by default.