From 2d45bc0da3a4b98bd451b6962ede5a3ee9c9f9ce Mon Sep 17 00:00:00 2001 From: Mike Selander Date: Wed, 20 May 2020 10:58:42 -0600 Subject: [PATCH 1/4] Update minimum version of eslint-plugin-react --- packages/eslint-config-humanmade/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/eslint-config-humanmade/package.json b/packages/eslint-config-humanmade/package.json index 2e5b82ff..b7c057d9 100644 --- a/packages/eslint-config-humanmade/package.json +++ b/packages/eslint-config-humanmade/package.json @@ -16,7 +16,7 @@ "eslint-plugin-flowtype": "^3.2.0", "eslint-plugin-import": "^2.14.0", "eslint-plugin-jsx-a11y": "^6.1.2", - "eslint-plugin-react": "^7.11.1", + "eslint-plugin-react": "^7.14.3", "eslint-plugin-sort-destructure-keys": "^1.3.3" }, "peerDependencies": { @@ -26,7 +26,7 @@ "eslint-plugin-flowtype": "^3.2.0", "eslint-plugin-import": "^2.14.0", "eslint-plugin-jsx-a11y": "^6.1.2", - "eslint-plugin-react": "^7.11.1" + "eslint-plugin-react": "^7.14.3" }, "files": [ ".eslintrc", From c35f6051e71b3a802b0de96247de9617c9a5c4fe Mon Sep 17 00:00:00 2001 From: Mike Selander Date: Wed, 20 May 2020 11:00:34 -0600 Subject: [PATCH 2/4] Add eslint-plugin-react-hooks package --- packages/eslint-config-humanmade/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/eslint-config-humanmade/package.json b/packages/eslint-config-humanmade/package.json index b7c057d9..61d7af76 100644 --- a/packages/eslint-config-humanmade/package.json +++ b/packages/eslint-config-humanmade/package.json @@ -17,6 +17,7 @@ "eslint-plugin-import": "^2.14.0", "eslint-plugin-jsx-a11y": "^6.1.2", "eslint-plugin-react": "^7.14.3", + "eslint-plugin-react-hooks": "^4.0.2", "eslint-plugin-sort-destructure-keys": "^1.3.3" }, "peerDependencies": { @@ -26,7 +27,8 @@ "eslint-plugin-flowtype": "^3.2.0", "eslint-plugin-import": "^2.14.0", "eslint-plugin-jsx-a11y": "^6.1.2", - "eslint-plugin-react": "^7.14.3" + "eslint-plugin-react": "^7.14.3", + "eslint-plugin-react-hooks": "^4.0.2" }, "files": [ ".eslintrc", From a369362cde83fbabcb9053803727a0de5bed3cdd Mon Sep 17 00:00:00 2001 From: Mike Selander Date: Wed, 20 May 2020 11:21:41 -0600 Subject: [PATCH 3/4] Enable React Hooks rules --- packages/eslint-config-humanmade/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/eslint-config-humanmade/index.js b/packages/eslint-config-humanmade/index.js index 599ffa99..16044adc 100644 --- a/packages/eslint-config-humanmade/index.js +++ b/packages/eslint-config-humanmade/index.js @@ -7,6 +7,7 @@ module.exports = { 'extends': [ 'eslint:recommended', 'react-app', + 'plugin:react-hooks/recommended', ], 'parserOptions': { 'ecmaVersion': 2018, From 64abe383b4d77b785caba2aa31842f6cdfedb83f Mon Sep 17 00:00:00 2001 From: Mike Selander Date: Wed, 20 May 2020 11:31:59 -0600 Subject: [PATCH 4/4] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2988f0c5..05f263aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Included `WordPress-Docs` by default in PHPCS #177 - Add ESLint rule for JSX boolean values #183 - Add ESLint rule for sorting JSX props #195 + - Add ESLInt Rules of Hooks ruleset #197 ### Updated: - Updated WPCS to 2.2.1 #151