Skip to content

Commit 1c090f1

Browse files
committed
Manually add lint entries provided by plugin:react-hooks/recommended
1 parent 6898185 commit 1c090f1

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.eslintrc.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,14 +314,17 @@ module.exports = {
314314
'test/jest/rendering.js',
315315
'ui/**/*.js',
316316
],
317-
extends: ['plugin:react/recommended', 'plugin:react-hooks/recommended'],
317+
extends: ['plugin:react/recommended'],
318318
parserOptions: {
319319
ecmaFeatures: {
320320
jsx: true,
321321
},
322322
},
323-
plugins: ['react', 'react-compiler'],
323+
plugins: ['react', 'react-hooks', 'react-compiler'],
324324
rules: {
325+
// react-hooks rules (manually configured due to eslint-plugin-react-hooks v6+ incompatibility with legacy config)
326+
'react-hooks/rules-of-hooks': 'error',
327+
'react-hooks/exhaustive-deps': 'warn',
325328
'react-compiler/react-compiler': 'error',
326329
'react/no-unused-prop-types': 'error',
327330
'react/no-unused-state': 'error',
@@ -357,14 +360,17 @@ module.exports = {
357360
*/
358361
{
359362
files: ['ui/**/*.ts', 'ui/**/*.tsx'],
360-
extends: ['plugin:react/recommended', 'plugin:react-hooks/recommended'],
363+
extends: ['plugin:react/recommended'],
361364
parserOptions: {
362365
ecmaFeatures: {
363366
jsx: true,
364367
},
365368
},
366-
plugins: ['react', 'react-compiler'],
369+
plugins: ['react', 'react-hooks', 'react-compiler'],
367370
rules: {
371+
// react-hooks rules (manually configured due to eslint-plugin-react-hooks v6+ incompatibility with legacy config)
372+
'react-hooks/rules-of-hooks': 'error',
373+
'react-hooks/exhaustive-deps': 'warn',
368374
'react-compiler/react-compiler': 'error',
369375
'react/no-unused-prop-types': 'warn',
370376
'react/no-unused-state': 'warn',

0 commit comments

Comments
 (0)