Skip to content

Commit aaf3d1d

Browse files
committed
feat: enable eslint-plugin-react-hooks
BREAKING CHANGE: This introduce new errors about React Hooks
1 parent 4f42a62 commit aaf3d1d

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

lib/react.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
plugins: ["react"],
2+
plugins: ["react", "react-hooks"],
33
extends: ["plugin:react/recommended"],
44
parserOptions: {
55
ecmaFeatures: {
@@ -94,7 +94,7 @@ module.exports = {
9494
afterOpening: "never"
9595
}
9696
],
97-
"react/jsx-wrap-multilines": "warn"
97+
"react/jsx-wrap-multilines": "warn",
9898

9999
// =======
100100
// None
@@ -129,5 +129,11 @@ module.exports = {
129129
// react/jsx-sort-default-props
130130
// react/jsx-sort-props
131131
// react/jsx-space-before-closing deprecated
132+
133+
// =======
134+
// Hooks
135+
// =======
136+
"react-hooks/rules-of-hooks": "error",
137+
"react-hooks/exhaustive-deps": "warn"
132138
}
133139
};

package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"eslint-plugin-jsx-a11y": "6.2.1",
4949
"eslint-plugin-node": "^8.0.1",
5050
"eslint-plugin-prettier": "^3.0.1",
51-
"eslint-plugin-react": "^7.12.4"
51+
"eslint-plugin-react": "^7.12.4",
52+
"eslint-plugin-react-hooks": "^1.6.0"
5253
}
5354
}

0 commit comments

Comments
 (0)