Skip to content

Commit e7a4e4b

Browse files
Copilotcklin
andcommitted
Fix eslint-plugin-react-hooks 7.0.1 linting issues
Co-authored-by: cklin <[email protected]>
1 parent f1efdd3 commit e7a4e4b

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

extensions/ql-vscode/eslint.config.mjs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,13 @@ export default tseslint.config(
122122
version: "detect",
123123
},
124124
},
125+
rules: {
126+
// Disable new strict rules from eslint-plugin-react-hooks 7.0.1
127+
"react-hooks/set-state-in-effect": "off",
128+
"react-hooks/refs": "off",
129+
"react-hooks/purity": "off",
130+
"react-hooks/error-boundaries": "off",
131+
},
125132
},
126133
{
127134
files: ["src/view/**/*"],
@@ -141,6 +148,24 @@ export default tseslint.config(
141148
version: "detect",
142149
},
143150
},
151+
rules: {
152+
// Disable new strict rules from eslint-plugin-react-hooks 7.0.1
153+
"react-hooks/set-state-in-effect": "off",
154+
"react-hooks/refs": "off",
155+
"react-hooks/purity": "off",
156+
"react-hooks/error-boundaries": "off",
157+
},
158+
},
159+
{
160+
// Special case for files using custom useEffectEvent implementation
161+
files: [
162+
"src/view/common/SuggestBox/useOpenKey.ts",
163+
"src/view/common/SuggestBox/__tests__/useEffectEvent.test.ts",
164+
],
165+
rules: {
166+
"react-hooks/rules-of-hooks": "off",
167+
"react-hooks/exhaustive-deps": "off",
168+
},
144169
},
145170
{
146171
files: ["test/vscode-tests/**/*"],

0 commit comments

Comments
 (0)