diff --git a/rules/react-hooks.js b/rules/react-hooks.js new file mode 100644 index 0000000..33c6d2e --- /dev/null +++ b/rules/react-hooks.js @@ -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'], + }, +};