diff --git a/.eslintrc b/.eslintrc index b19c067..f90b4fe 100644 --- a/.eslintrc +++ b/.eslintrc @@ -13,7 +13,8 @@ "jsx": true }, "plugins": [ - "react" + "react", + "react-hooks" ], "rules": { "strict": 1, @@ -22,6 +23,8 @@ "camelcase": 1, "no-underscore-dangle": 1, "react/jsx-uses-react": 1, - "react/jsx-uses-vars": 1 + "react/jsx-uses-vars": 1, + "react-hooks/rules-of-hooks": "error", + "react-hooks/exhaustive-deps": "warn" } } diff --git a/package.json b/package.json index ff2f190..c44f0a3 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "del": "^3.0.0", "eslint": "^5.16.0", "eslint-plugin-react": "^7.6.1", + "eslint-plugin-react-hooks": "^1.6.0", "file-loader": "^3.0.1", "less": "^2.3.1", "less-loader": "^4.0.5", diff --git a/yarn.lock b/yarn.lock index 52f7e76..983571d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2500,6 +2500,11 @@ escope@^3.6.0: esrecurse "^4.1.0" estraverse "^4.1.1" +eslint-plugin-react-hooks@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.6.0.tgz#348efcda8fb426399ac7b8609607c7b4025a6f5f" + integrity sha512-lHBVRIaz5ibnIgNG07JNiAuBUeKhEf8l4etNx5vfAEwqQ5tcuK3jV9yjmopPgQDagQb7HwIuQVsE3IVcGrRnag== + eslint-plugin-react@^7.6.1: version "7.13.0" resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.13.0.tgz#bc13fd7101de67996ea51b33873cd9dc2b7e5758"