Skip to content

Commit

Permalink
Upgrade eslint-plugin-react-hooks to v5 (#1459)
Browse files Browse the repository at this point in the history
  • Loading branch information
szhsin authored Jan 9, 2025
1 parent e7f7424 commit 877882e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 36 deletions.
4 changes: 1 addition & 3 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @ts-check

import eslint from '@eslint/js';
import { fixupPluginRules } from '@eslint/compat';
import globals from 'globals';
import prettier from 'eslint-config-prettier';
import jest from 'eslint-plugin-jest';
Expand Down Expand Up @@ -42,8 +41,7 @@ export default [
plugins: {
jest,
react,
// @ts-ignore
['react-hooks']: fixupPluginRules(reactHooks)
'react-hooks': reactHooks
},
rules: {
'no-console': ['error', { allow: ['warn', 'error'] }],
Expand Down
4 changes: 2 additions & 2 deletions example/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@
"rootDir": "example/"
}
},
"plugins": ["react", "react-hooks", "react-hooks-addons"],
"plugins": ["react"],
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@next/next/recommended",
"plugin:react-hooks/recommended",
"plugin:react-hooks-addons/recommended-legacy",
"prettier"
],
"rules": {
Expand All @@ -39,7 +40,6 @@
"react/prop-types": 0,
"react/display-name": 0,
"react/react-in-jsx-scope": 0,
"react-hooks-addons/no-unused-deps": "warn",
"@next/next/no-img-element": 0
}
}
29 changes: 5 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 1 addition & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"@babel/core": "^7.26.0",
"@babel/preset-env": "^7.25.4",
"@babel/preset-react": "^7.25.9",
"@eslint/compat": "^1.2.4",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-node-resolve": "^16.0.0",
"@testing-library/jest-dom": "^6.5.0",
Expand All @@ -62,7 +61,7 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^28.9.0",
"eslint-plugin-react": "^7.37.1",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-hooks-addons": "^0.4.1",
"globals": "^15.13.0",
"jest": "^29.7.0",
Expand All @@ -76,11 +75,6 @@
"sass": "^1.80.3",
"typescript": "^5.7.2"
},
"overrides": {
"eslint-plugin-react-hooks": {
"eslint": "$eslint"
}
},
"keywords": [
"react",
"menu",
Expand Down

0 comments on commit 877882e

Please sign in to comment.