Skip to content

Commit 33d885e

Browse files
committed
feat(hooks): added rules for react hooks
1 parent e8f99dd commit 33d885e

File tree

3 files changed

+75
-65
lines changed

3 files changed

+75
-65
lines changed

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
module.exports = {
2+
plugins: ['react-hooks'],
3+
24
rules: {
35
'react/jsx-filename-extension': ['error', {extensions: ['.js']}],
4-
'react/require-default-props': 'off'
6+
'react/require-default-props': 'off',
7+
'react-hooks/rules-of-hooks': 'error',
8+
'react-hooks/exhaustive-deps': 'warn'
59
},
610

711
overrides: [{

package-lock.json

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

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,8 @@
3030
"npm-run-all": "^4.1.5",
3131
"remark-cli": "^6.0.1",
3232
"travis-lint": "^1.0.0"
33+
},
34+
"dependencies": {
35+
"eslint-plugin-react-hooks": "1.6.1"
3336
}
3437
}

0 commit comments

Comments
 (0)