diff --git a/.eslintrc.js b/.eslintrc.js index 33d28967ff..09e6bd3819 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -50,6 +50,7 @@ module.exports = { plugins: [ "header", "unused-imports", + "react-hooks" ], rules: { "header/header": [2, "./license-header"], @@ -210,7 +211,9 @@ module.exports = { { "blankLine": "always", "prev": "*", "next": "class" }, { "blankLine": "always", "prev": ["const", "let", "var"], "next": "*" }, { "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var"]}, - ] + ], + "react-hooks/rules-of-hooks": "error", + "react-hooks/exhaustive-deps": "off" }, } ] diff --git a/package.json b/package.json index 05b6457357..02b2c494e9 100644 --- a/package.json +++ b/package.json @@ -316,6 +316,7 @@ "eslint": "^7.7.0", "eslint-plugin-header": "^3.1.1", "eslint-plugin-react": "^7.21.5", + "eslint-plugin-react-hooks": "^4.2.0", "eslint-plugin-unused-imports": "^1.0.1", "file-loader": "^6.0.0", "flex.box": "^3.4.4", diff --git a/yarn.lock b/yarn.lock index 2be3cbfbcb..1839db4d2b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5278,6 +5278,11 @@ eslint-plugin-header@^3.1.1: resolved "https://registry.yarnpkg.com/eslint-plugin-header/-/eslint-plugin-header-3.1.1.tgz#6ce512432d57675265fac47292b50d1eff11acd6" integrity sha512-9vlKxuJ4qf793CmeeSrZUvVClw6amtpghq3CuWcB5cUNnWHQhgcqy5eF8oVKFk1G3Y/CbchGfEaw3wiIJaNmVg== +eslint-plugin-react-hooks@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.2.0.tgz#8c229c268d468956334c943bb45fc860280f5556" + integrity sha512-623WEiZJqxR7VdxFCKLI6d6LLpwJkGPYKODnkH3D7WpOG5KM8yWueBd8TLsNAetEJNF5iJmolaAKO3F8yzyVBQ== + eslint-plugin-react@^7.21.5: version "7.21.5" resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.21.5.tgz#50b21a412b9574bfe05b21db176e8b7b3b15bff3"