diff --git a/.eslintrc.js b/.eslintrc.js index 7ac2b6d..c9fdedc 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,29 +1,38 @@ module.exports = { env: { browser: true, - es2021: true + es2021: true, }, - extends: ['plugin:react/recommended', 'prettier', 'plugin:storybook/recommended'], + extends: [ + 'plugin:react/recommended', + 'prettier', + 'plugin:storybook/recommended', + ], parser: '@typescript-eslint/parser', parserOptions: { ecmaFeatures: { - jsx: true + jsx: true, }, ecmaVersion: 12, - sourceType: 'module' + sourceType: 'module', }, - plugins: ['@typescript-eslint', 'prettier'], + plugins: ['@typescript-eslint', 'prettier', 'react-hooks'], rules: { '@typescript-eslint/no-unused-vars': 'error', - 'prefer-const': ['warn', { - destructuring: 'all' - }], + 'prefer-const': [ + 'warn', + { + destructuring: 'all', + }, + ], 'no-var': 'error', - eqeqeq: ['error', 'smart'] + eqeqeq: ['error', 'smart'], + 'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks + 'react-hooks/exhaustive-deps': 'off', // Checks effect dependencies }, settings: { react: { - version: 'detect' - } - } -}; \ No newline at end of file + version: 'detect', + }, + }, +}; diff --git a/package.json b/package.json index 3e7adb2..196a368 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "eslint-plugin-prettier": "^3.4.0", "eslint-plugin-promise": "^5.1.0", "eslint-plugin-react": "^7.27.1", + "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-storybook": "^0.5.12", "jest": "^27.0.4", "prettier": "^2.3.1",