Skip to content

Commit

Permalink
feat(eslint-config-carbon): add react-hooks plugin (#3087)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblack authored and asudoh committed Jun 17, 2019
1 parent f513017 commit 08f0f99
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
Binary file not shown.
4 changes: 3 additions & 1 deletion packages/eslint-config-carbon/index.js
Expand Up @@ -10,7 +10,7 @@
module.exports = {
parser: 'babel-eslint',
extends: ['eslint:recommended', 'plugin:jsx-a11y/recommended'],
plugins: ['react', 'jsdoc', 'jsx-a11y'],
plugins: ['react', 'jsdoc', 'jsx-a11y', 'react-hooks'],
rules: {
// Handle cases where we are destructuring but may not be using the initial
// variables
Expand All @@ -26,6 +26,8 @@ module.exports = {
'react/jsx-uses-react': 1,
'react/no-find-dom-node': 1,
'react/no-typos': 2,
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
'jsdoc/check-param-names': 2,
'jsdoc/check-tag-names': 2,
'jsdoc/check-types': 2,
Expand Down
4 changes: 3 additions & 1 deletion packages/eslint-config-carbon/package.json
Expand Up @@ -25,6 +25,7 @@
"eslint-plugin-jsdoc": "^7.2.3",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.13.0",
"eslint-plugin-react-hooks": "^1.6.0",
"eslint-restricted-globals": "^0.1.0"
},
"dependencies": {
Expand All @@ -34,6 +35,7 @@
"eslint": "^5.16.0",
"eslint-plugin-jsdoc": "^7.2.3",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.13.0"
"eslint-plugin-react": "^7.13.0",
"eslint-plugin-react-hooks": "^1.6.0"
}
}
1 change: 1 addition & 0 deletions packages/react/package.json
Expand Up @@ -96,6 +96,7 @@
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.12.1",
"enzyme-to-json": "^3.3.5",
"eslint-plugin-react-hooks": "^1.6.0",
"gzip-size": "^5.0.0",
"jest": "^24.0.0",
"jest-circus": "^24.0.0",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Expand Up @@ -8340,6 +8340,11 @@ eslint-plugin-prettier@^2.3.1:
fast-diff "^1.1.1"
jest-docblock "^21.0.0"

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.11.0, eslint-plugin-react@^7.13.0:
version "7.13.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.13.0.tgz#bc13fd7101de67996ea51b33873cd9dc2b7e5758"
Expand Down

0 comments on commit 08f0f99

Please sign in to comment.