diff --git a/package.json b/package.json index 7324494..9f1e02e 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,8 @@ }, "homepage": "https://github.com/appliedblockchain/eslint-config#readme", "devDependencies": { - "eslint": "^5.13.0" + "eslint": "^5.13.0", + "eslint-plugin-react-hooks": "^1.3.0" }, "dependencies": { "babel-eslint": "^10.0.1", diff --git a/react.js b/react.js index bdcc3be..b54542c 100644 --- a/react.js +++ b/react.js @@ -12,13 +12,16 @@ module.exports = { parser: 'babel-eslint', plugins: [ - 'react' + 'react', + 'react-hooks' ], rules: { 'jsx-quotes': [ error, 'prefer-double' ], 'react/forbid-prop-types': [ error, { forbid: [ any ] } ], 'no-multiple-empty-lines': [ error, { max: 1 } ], + 'react-hooks/rules-of-hooks': 'error', + 'react-hooks/exhaustive-deps': 'warn', 'react/jsx-boolean-value': [ off ], 'react/jsx-indent': [ warn, 2 ], 'react/jsx-indent-props': [ warn, 2 ],