Skip to content

Commit abb5b97

Browse files
committedAug 8, 2019
adding hooks
1 parent 7b21de1 commit abb5b97

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed
 

‎.eslintrc.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ module.exports = {
2222
},
2323
plugins: [
2424
'react',
25-
'prettier'
25+
'prettier',
26+
'react-hooks'
2627
],
2728
rules: {
2829
'prettier/prettier': 'error',
@@ -34,6 +35,9 @@ module.exports = {
3435
],
3536
'import/prefer-default-export': 'off',
3637
'no-param-reassign': 'off',
37-
'no-console': ["error", {allow: ["tron"]}]
38+
'no-console': ["error", {allow: ["tron"]}],
39+
40+
'react-hooks/rules-of-hooks': 'error',
41+
'react-hooks/exhaustive-deps': 'warn'
3842
},
3943
};

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"eslint-plugin-jsx-a11y": "^6.2.3",
5151
"eslint-plugin-prettier": "^3.1.0",
5252
"eslint-plugin-react": "^7.14.3",
53+
"eslint-plugin-react-hooks": "^1.7.0",
5354
"prettier": "^1.18.2"
5455
}
5556
}

‎yarn.lock

+5
Original file line numberDiff line numberDiff line change
@@ -3745,6 +3745,11 @@ eslint-plugin-react-hooks@^1.5.0:
37453745
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.6.0.tgz#348efcda8fb426399ac7b8609607c7b4025a6f5f"
37463746
integrity sha512-lHBVRIaz5ibnIgNG07JNiAuBUeKhEf8l4etNx5vfAEwqQ5tcuK3jV9yjmopPgQDagQb7HwIuQVsE3IVcGrRnag==
37473747

3748+
eslint-plugin-react-hooks@^1.7.0:
3749+
version "1.7.0"
3750+
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.7.0.tgz#6210b6d5a37205f0b92858f895a4e827020a7d04"
3751+
integrity sha512-iXTCFcOmlWvw4+TOE8CLWj6yX1GwzT0Y6cUfHHZqWnSk144VmVIRcVGtUAzrLES7C798lmvnt02C7rxaOX1HNA==
3752+
37483753
eslint-plugin-react@7.12.4:
37493754
version "7.12.4"
37503755
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.12.4.tgz#b1ecf26479d61aee650da612e425c53a99f48c8c"

0 commit comments

Comments
 (0)
Please sign in to comment.