Skip to content

Commit b557d0f

Browse files
belovinhoxobotyi
andauthored
fix: proper configuration of react-hooks plugin (#925)
Co-authored-by: xobotyi <[email protected]>
1 parent e592d7d commit b557d0f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

configs/react.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,17 @@ import { adjustESLintConfigFiles } from './base.js';
55
/** @var {Linter.Config[]} */
66
const reactConfig = [
77
pluginReact.configs.flat.recommended,
8-
pluginReactHooks.configs.recommended,
8+
{
9+
plugins: {
10+
'react-hooks': {
11+
rules: pluginReactHooks.rules,
12+
},
13+
},
14+
rules: {
15+
'react-hooks/rules-of-hooks': 'error',
16+
'react-hooks/exhaustive-deps': 'warn',
17+
},
18+
},
919
{
1020
rules: {
1121
// While using ts with `react-jsx` preset - there

0 commit comments

Comments
 (0)