Skip to content

Commit 7243e7a

Browse files
authored
Merge pull request #4182 from github/dependabot/npm_and_yarn/extensions/ql-vscode/eslint-plugin-react-hooks-7.0.1
Bump eslint-plugin-react-hooks from 5.2.0 to 7.0.1 in /extensions/ql-vscode
2 parents 58fa916 + 2d75753 commit 7243e7a

File tree

3 files changed

+77
-8
lines changed

3 files changed

+77
-8
lines changed

extensions/ql-vscode/eslint.config.mjs

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export default tseslint.config(
113113
extends: [
114114
react.configs.flat.recommended,
115115
react.configs.flat['jsx-runtime'],
116-
reactHooks.configs['recommended-latest'],
116+
reactHooks.configs.flat['recommended-latest'],
117117
storybook.configs['flat/recommended'],
118118
github.getFlatConfigs().react,
119119
],
@@ -122,6 +122,10 @@ export default tseslint.config(
122122
version: "detect",
123123
},
124124
},
125+
rules: {
126+
// Disable new strict rules from eslint-plugin-react-hooks 7.0.1 that fail with current codebase
127+
"react-hooks/set-state-in-effect": "off",
128+
},
125129
},
126130
{
127131
files: ["src/view/**/*"],
@@ -133,14 +137,32 @@ export default tseslint.config(
133137
extends: [
134138
react.configs.flat.recommended,
135139
react.configs.flat['jsx-runtime'],
136-
reactHooks.configs['recommended-latest'],
140+
reactHooks.configs.flat['recommended-latest'],
137141
github.getFlatConfigs().react,
138142
],
139143
settings: {
140144
react: {
141145
version: "detect",
142146
},
143147
},
148+
rules: {
149+
// Disable new strict rules from eslint-plugin-react-hooks 7.0.1 that fail with current codebase
150+
"react-hooks/set-state-in-effect": "off",
151+
"react-hooks/refs": "off",
152+
"react-hooks/purity": "off",
153+
"react-hooks/error-boundaries": "off",
154+
},
155+
},
156+
{
157+
// Special case for files using custom useEffectEvent implementation
158+
files: [
159+
"src/view/common/SuggestBox/useOpenKey.ts",
160+
"src/view/common/SuggestBox/__tests__/useEffectEvent.test.ts",
161+
],
162+
rules: {
163+
"react-hooks/rules-of-hooks": "off",
164+
"react-hooks/exhaustive-deps": "off",
165+
},
144166
},
145167
{
146168
files: ["test/vscode-tests/**/*"],

extensions/ql-vscode/package-lock.json

Lines changed: 52 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/ql-vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2105,7 +2105,7 @@
21052105
"eslint-plugin-jest-dom": "^5.5.0",
21062106
"eslint-plugin-prettier": "^5.2.6",
21072107
"eslint-plugin-react": "^7.37.5",
2108-
"eslint-plugin-react-hooks": "^5.2.0",
2108+
"eslint-plugin-react-hooks": "^7.0.1",
21092109
"eslint-plugin-storybook": "^9.0.12",
21102110
"glob": "^11.0.1",
21112111
"gulp": "^5.0.0",

0 commit comments

Comments
 (0)