From 0876c7a30877bd44da922cd544d51a580f867f09 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 9 Jun 2020 22:52:24 -0500 Subject: [PATCH] ESLint: react-hooks --- .eslintrc.js | 4 ++++ package.json | 1 + yarn.lock | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index aaeaedc8d..7db751fec 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -19,6 +19,7 @@ module.exports = { 'jsx-a11y', 'import', 'promise', + 'react-hooks', ], parserOptions: { @@ -205,5 +206,8 @@ module.exports = { 'import/no-webpack-loader-syntax': 'error', 'promise/catch-or-return': 'error', + + 'react-hooks/rules-of-hooks': 'error', + 'react-hooks/exhaustive-deps': 'warn', }, }; diff --git a/package.json b/package.json index b2c1ed844..ac5d794ac 100644 --- a/package.json +++ b/package.json @@ -156,6 +156,7 @@ "eslint-plugin-jsx-a11y": "~6.2.3", "eslint-plugin-promise": "~4.2.0", "eslint-plugin-react": "~7.17.0", + "eslint-plugin-react-hooks": "^4.0.4", "jest": "^26.0.1", "raf": "^3.4.1", "react-intl-translations-manager": "^5.0.3", diff --git a/yarn.lock b/yarn.lock index 0d37c4e7e..b9f90d0f3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4523,6 +4523,11 @@ eslint-plugin-promise@~4.2.0: resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-4.2.1.tgz#845fd8b2260ad8f82564c1222fce44ad71d9418a" integrity sha512-VoM09vT7bfA7D+upt+FjeBO5eHIJQBUWki1aPvB+vbNiHS3+oGIJGIeyBtKQTME6UPXXy3vV07OL1tHd3ANuDw== +eslint-plugin-react-hooks@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.0.4.tgz#aed33b4254a41b045818cacb047b81e6df27fa58" + integrity sha512-equAdEIsUETLFNCmmCkiCGq6rkSK5MoJhXFPFYeUebcjKgBmWWcgVOqZyQC8Bv1BwVCnTq9tBxgJFgAJTWoJtA== + eslint-plugin-react@~7.17.0: version "7.17.0" resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.17.0.tgz#a31b3e134b76046abe3cd278e7482bd35a1d12d7"