From 0f9b9b9dcfd2470df2ecd5619663276cdd5da039 Mon Sep 17 00:00:00 2001 From: Akshay Joshi Date: Wed, 1 Dec 2021 17:43:20 +0530 Subject: [PATCH] Added 'eslint-plugin-react-hooks' to identify the linter errors related to react hooks. --- web/.eslintrc.js | 5 +++++ web/package.json | 1 + web/yarn.lock | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/web/.eslintrc.js b/web/.eslintrc.js index dc5531948..3677c976f 100644 --- a/web/.eslintrc.js +++ b/web/.eslintrc.js @@ -17,6 +17,11 @@ module.exports = { 'extends': [ 'eslint:recommended', 'plugin:react/recommended', + /* Uncomment the below line to use linter error for React Hooks. + By Default commented so that builds are generated successfully. + Once all the errors will be resolved will uncomment it and commit it. + */ + // "plugin:react-hooks/recommended", ], 'parser': '@babel/eslint-parser', 'parserOptions': { diff --git a/web/package.json b/web/package.json index 8e3393786..2cba919f9 100644 --- a/web/package.json +++ b/web/package.json @@ -31,6 +31,7 @@ "enzyme": "^3.11.0", "eslint": "^7.19.0", "eslint-plugin-react": "^7.20.5", + "eslint-plugin-react-hooks": "^4.3.0", "exports-loader": "^2.0.0", "html-react-parser": "^1.2.7", "image-minimizer-webpack-plugin": "^2.2.0", diff --git a/web/yarn.lock b/web/yarn.lock index a4e3c494e..087784940 100644 --- a/web/yarn.lock +++ b/web/yarn.lock @@ -4078,6 +4078,11 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= +eslint-plugin-react-hooks@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.3.0.tgz#318dbf312e06fab1c835a4abef00121751ac1172" + integrity sha512-XslZy0LnMn+84NEG9jSGR6eGqaZB3133L8xewQo3fQagbQuGt7a63gf+P1NGKZavEYEC3UXaWEAA/AqDkuN6xA== + eslint-plugin-react@^7.20.5: version "7.23.2" resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.23.2.tgz#2d2291b0f95c03728b55869f01102290e792d494"