Browse Source

linting: fix react-hooks settings

Mokhtar Naamani 4 years ago
parent
commit
0ca2c382f1
1 changed files with 5 additions and 1 deletions
  1. 5 1
      devops/eslint-config/index.js

+ 5 - 1
devops/eslint-config/index.js

@@ -22,7 +22,7 @@ module.exports = {
     'eslint:recommended',
     'plugin:@typescript-eslint/recommended',
     'plugin:react/recommended',
-    'plugin:react-hooks/recommended',
+    // 'plugin:react-hooks/recommended', // this is only in newer versions
 
     // jsx-a11y conflicts with pioneer rules. At time of writing
     // 84 problems -> We want to avoid as much as possible changing code in pioneer at least
@@ -46,5 +46,9 @@ module.exports = {
       version: 'detect',
     },
   },
+  rules: {
+    'react-hooks/rules-of-hooks': 'error',
+    'react-hooks/exhaustive-deps': 'warn',
+  },
   plugins: ['@typescript-eslint', 'react', 'react-hooks'],
 }