diff --git a/package.json b/package.json index ac8a583..05744df 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/configs/eslint/config.js b/src/configs/eslint/config.js index 75c9755..5f13e46 100644 --- a/src/configs/eslint/config.js +++ b/src/configs/eslint/config.js @@ -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': [ { diff --git a/yarn.lock b/yarn.lock index 1fdf53d..acf69b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"