react-hooks.js 629 B

123456789101112131415161718192021
  1. module.exports = {
  2. plugins: [
  3. 'react-hooks',
  4. ],
  5. parserOptions: {
  6. ecmaFeatures: {
  7. jsx: true,
  8. },
  9. },
  10. rules: {
  11. // Enforce Rules of Hooks
  12. // https://github.com/facebook/react/blob/c11015ff4f610ac2924d1fc6d569a17657a404fd/packages/eslint-plugin-react-hooks/src/RulesOfHooks.js
  13. 'react-hooks/rules-of-hooks': 'error',
  14. // Verify the list of the dependencies for Hooks like useEffect and similar
  15. // https://github.com/facebook/react/blob/1204c789776cb01fbaf3e9f032e7e2ba85a44137/packages/eslint-plugin-react-hooks/src/ExhaustiveDeps.js
  16. 'react-hooks/exhaustive-deps': 'error',
  17. },
  18. };