Skip to content

Commit

Permalink
feat: Implement the rule "react-hooks" (#226)
Browse files Browse the repository at this point in the history
* feat: Implement the rule "react-hooks"

* add comments
  • Loading branch information
wakamsha authored Mar 11, 2024
1 parent 7fe1bd4 commit d1e574d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions rules/react-hooks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
plugins: ['react-hooks'],

rules: {
// Verify the list of the dependencies for Hooks like useEffect and similar.
// https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/src/ExhaustiveDeps.js
'react-hooks/exhaustive-deps': ['error'],

// Enforce Rules of Hooks.
// https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/src/RulesOfHooks.js
'react-hooks/rules-of-hooks': ['error'],
},
};

0 comments on commit d1e574d

Please sign in to comment.