Skip to content

Commit

Permalink
Add lint rule for hooks
Browse files Browse the repository at this point in the history
Reviewed By: rckclmbr

Differential Revision: D14701605

fbshipit-source-id: 49e6169263e3830d21144ea434a5ba3e9076e607
  • Loading branch information
Murtadha Al-Tameemi authored and facebook-github-bot committed Apr 5, 2019
1 parent c924d8b commit d2bb0d8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nms/fbcnms-packages/eslint-config-fbcnms/index.js
Expand Up @@ -62,6 +62,7 @@ module.exports = Object.assign({}, fbStrict, {
'node',
'prettier',
'react',
'react-hooks',
'relay',
],
rules: {
Expand Down Expand Up @@ -143,6 +144,10 @@ module.exports = Object.assign({}, fbStrict, {
'react/self-closing-comp': 1,
'react/wrap-multilines': 0,

// React Hooks Plugin
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',

// Jest Plugin
// The following rules are made available via `eslint-plugin-jest`.
// 'jest/no-disabled-tests': 1,
Expand Down
1 change: 1 addition & 0 deletions nms/package.json
Expand Up @@ -41,6 +41,7 @@
"eslint-plugin-node": "^7.0.1",
"eslint-plugin-prettier": "2.6.0",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react-hooks": "^1.6.0",
"eslint-plugin-relay": "^1.0.0",
"jest": "24.3.0",
"prettier": "1.16.4",
Expand Down
5 changes: 5 additions & 0 deletions nms/yarn.lock
Expand Up @@ -5567,6 +5567,11 @@ eslint-plugin-prettier@2.6.0:
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.12.4:
version "7.12.4"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.12.4.tgz#b1ecf26479d61aee650da612e425c53a99f48c8c"
Expand Down

0 comments on commit d2bb0d8

Please sign in to comment.