Skip to content

Commit

Permalink
Add ESLint plugin react hooks to enable linting hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
viralganatra committed Aug 28, 2019
1 parent 52dcd72 commit aa4f48c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "^7.14.3",
"eslint-plugin-react-hooks": "^2.0.1",
"husky": "^3.0.4",
"identity-obj-proxy": "^3.0.0",
"is-ci": "^2.0.0",
Expand Down
4 changes: 4 additions & 0 deletions src/configs/eslint/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,15 @@ module.exports = {
'jsx-a11y/label-has-for': ['off'],

'prettier/prettier': ['error', prettier],

'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
},
'plugins': [
'babel',
'react',
'prettier',
'react-hooks',
],
'overrides': [
{
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2282,6 +2282,11 @@ eslint-plugin-prettier@^3.1.0:
dependencies:
prettier-linter-helpers "^1.0.0"

eslint-plugin-react-hooks@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-2.0.1.tgz#e898ec26a0a335af6f7b0ad1f0bedda7143ed756"
integrity sha512-xir+3KHKo86AasxlCV8AHRtIZPHljqCRRUYgASkbatmt0fad4+5GgC7zkT7o/06hdKM6MIwp8giHVXqBPaarHQ==

eslint-plugin-react@^7.14.3:
version "7.14.3"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.14.3.tgz#911030dd7e98ba49e1b2208599571846a66bdf13"
Expand Down

0 comments on commit aa4f48c

Please sign in to comment.