diff --git a/eslint.config.mjs b/eslint.config.mjs index 26b7990220..68ea70c103 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -3,12 +3,14 @@ import importOrderConfig from '@gravity-ui/eslint-config/import-order'; import prettierConfig from '@gravity-ui/eslint-config/prettier'; import typescriptParser from '@typescript-eslint/parser'; import importPlugin from 'eslint-plugin-import'; +import reactHooks from 'eslint-plugin-react-hooks'; import globals from 'globals'; export default [ { plugins: { import: importPlugin, + 'react-hooks': reactHooks, }, }, ...baseConfig, @@ -43,6 +45,7 @@ export default [ rules: { 'import/consistent-type-specifier-style': ['error', 'prefer-top-level'], curly: ['error', 'all'], + 'react-hooks/exhaustive-deps': 'warn', }, }, // TypeScript-specific rules that require type information diff --git a/package-lock.json b/package-lock.json index f01c6cbfef..5b4e9645ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -85,6 +85,7 @@ "@typescript-eslint/parser": "^8.34.1", "copyfiles": "^2.4.1", "eslint-plugin-import": "^2.31.0", + "eslint-plugin-react-hooks": "^5.2.0", "globals": "^16.2.0", "http-proxy-middleware": "^2.0.7", "husky": "^9.1.7", @@ -11695,6 +11696,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-5.2.0.tgz", "integrity": "sha512-+f15FfK64YQwZdJNELETdn5ibXEUQmW1DZL6KXhNnc2heoy/sg9VJJeT7n8TlMWouzWqSWavFkIhHyIbIAEapg==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, diff --git a/package.json b/package.json index 05facbe212..55dd15ad9b 100644 --- a/package.json +++ b/package.json @@ -148,6 +148,7 @@ "@typescript-eslint/parser": "^8.34.1", "copyfiles": "^2.4.1", "eslint-plugin-import": "^2.31.0", + "eslint-plugin-react-hooks": "^5.2.0", "globals": "^16.2.0", "http-proxy-middleware": "^2.0.7", "husky": "^9.1.7",