From 6c81a71c3a7bd282edf8c7ff3c52d4079bcbce7e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 13:01:52 +0000 Subject: [PATCH 1/2] Bump eslint-plugin-react-hooks in /extensions/ql-vscode Bumps [eslint-plugin-react-hooks](https://github.com/facebook/react/tree/HEAD/packages/eslint-plugin-react-hooks) from 5.2.0 to 7.0.1. - [Release notes](https://github.com/facebook/react/releases) - [Changelog](https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/CHANGELOG.md) - [Commits](https://github.com/facebook/react/commits/HEAD/packages/eslint-plugin-react-hooks) --- updated-dependencies: - dependency-name: eslint-plugin-react-hooks dependency-version: 7.0.1 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- extensions/ql-vscode/package-lock.json | 57 +++++++++++++++++++++++--- extensions/ql-vscode/package.json | 2 +- 2 files changed, 53 insertions(+), 6 deletions(-) diff --git a/extensions/ql-vscode/package-lock.json b/extensions/ql-vscode/package-lock.json index 00a9353420a..99790962adf 100644 --- a/extensions/ql-vscode/package-lock.json +++ b/extensions/ql-vscode/package-lock.json @@ -113,7 +113,7 @@ "eslint-plugin-jest-dom": "^5.5.0", "eslint-plugin-prettier": "^5.2.6", "eslint-plugin-react": "^7.37.5", - "eslint-plugin-react-hooks": "^5.2.0", + "eslint-plugin-react-hooks": "^7.0.1", "eslint-plugin-storybook": "^9.0.12", "glob": "^11.0.1", "gulp": "^5.0.0", @@ -13638,13 +13638,20 @@ } }, "node_modules/eslint-plugin-react-hooks": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-5.2.0.tgz", - "integrity": "sha512-+f15FfK64YQwZdJNELETdn5ibXEUQmW1DZL6KXhNnc2heoy/sg9VJJeT7n8TlMWouzWqSWavFkIhHyIbIAEapg==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.0.1.tgz", + "integrity": "sha512-O0d0m04evaNzEPoSW+59Mezf8Qt0InfgGIBJnpC0h3NH/WjUAR7BIKUfysC6todmtiZ/A0oUVS8Gce0WhBrHsA==", "dev": true, "license": "MIT", + "dependencies": { + "@babel/core": "^7.24.4", + "@babel/parser": "^7.24.4", + "hermes-parser": "^0.25.1", + "zod": "^3.25.0 || ^4.0.0", + "zod-validation-error": "^3.5.0 || ^4.0.0" + }, "engines": { - "node": ">=10" + "node": ">=18" }, "peerDependencies": { "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0" @@ -15470,6 +15477,23 @@ "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-4.0.2.tgz", "integrity": "sha512-EWGTfnTqAO2L/j5HZgoM/3z82L7necsJ0pO9Tp0X1wil3PDLrkypTBRgVO2ExehEEvUycejZD3FuRaXpZZc3kw==" }, + "node_modules/hermes-estree": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.25.1.tgz", + "integrity": "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==", + "dev": true, + "license": "MIT" + }, + "node_modules/hermes-parser": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.25.1.tgz", + "integrity": "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hermes-estree": "0.25.1" + } + }, "node_modules/hoist-non-react-statics": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", @@ -28404,6 +28428,29 @@ "engines": { "node": ">= 6" } + }, + "node_modules/zod": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.1.12.tgz", + "integrity": "sha512-JInaHOamG8pt5+Ey8kGmdcAcg3OL9reK8ltczgHTAwNhMys/6ThXHityHxVV2p3fkw/c+MAvBHFVYHFZDmjMCQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-validation-error": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-4.0.2.tgz", + "integrity": "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "zod": "^3.25.0 || ^4.0.0" + } } } } diff --git a/extensions/ql-vscode/package.json b/extensions/ql-vscode/package.json index ab38f0a2772..46582314318 100644 --- a/extensions/ql-vscode/package.json +++ b/extensions/ql-vscode/package.json @@ -2105,7 +2105,7 @@ "eslint-plugin-jest-dom": "^5.5.0", "eslint-plugin-prettier": "^5.2.6", "eslint-plugin-react": "^7.37.5", - "eslint-plugin-react-hooks": "^5.2.0", + "eslint-plugin-react-hooks": "^7.0.1", "eslint-plugin-storybook": "^9.0.12", "glob": "^11.0.1", "gulp": "^5.0.0", From 2d757532bdb48b98da476420ade3270b71a74c24 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 30 Oct 2025 15:17:02 -0700 Subject: [PATCH 2/2] Fix eslint-plugin-react-hooks 7.0.1 compatibility (#4186) * Initial plan * Update eslint-plugin-react-hooks configuration for flat config format Co-authored-by: cklin <1418580+cklin@users.noreply.github.com> * Fix eslint-plugin-react-hooks 7.0.1 linting issues Co-authored-by: cklin <1418580+cklin@users.noreply.github.com> * Only disable strict rules that actually fail with current codebase Co-authored-by: cklin <1418580+cklin@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: cklin <1418580+cklin@users.noreply.github.com> --- extensions/ql-vscode/eslint.config.mjs | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/extensions/ql-vscode/eslint.config.mjs b/extensions/ql-vscode/eslint.config.mjs index e453a1f9838..96f86a7c6ff 100644 --- a/extensions/ql-vscode/eslint.config.mjs +++ b/extensions/ql-vscode/eslint.config.mjs @@ -113,7 +113,7 @@ export default tseslint.config( extends: [ react.configs.flat.recommended, react.configs.flat['jsx-runtime'], - reactHooks.configs['recommended-latest'], + reactHooks.configs.flat['recommended-latest'], storybook.configs['flat/recommended'], github.getFlatConfigs().react, ], @@ -122,6 +122,10 @@ export default tseslint.config( version: "detect", }, }, + rules: { + // Disable new strict rules from eslint-plugin-react-hooks 7.0.1 that fail with current codebase + "react-hooks/set-state-in-effect": "off", + }, }, { files: ["src/view/**/*"], @@ -133,7 +137,7 @@ export default tseslint.config( extends: [ react.configs.flat.recommended, react.configs.flat['jsx-runtime'], - reactHooks.configs['recommended-latest'], + reactHooks.configs.flat['recommended-latest'], github.getFlatConfigs().react, ], settings: { @@ -141,6 +145,24 @@ export default tseslint.config( version: "detect", }, }, + rules: { + // Disable new strict rules from eslint-plugin-react-hooks 7.0.1 that fail with current codebase + "react-hooks/set-state-in-effect": "off", + "react-hooks/refs": "off", + "react-hooks/purity": "off", + "react-hooks/error-boundaries": "off", + }, + }, + { + // Special case for files using custom useEffectEvent implementation + files: [ + "src/view/common/SuggestBox/useOpenKey.ts", + "src/view/common/SuggestBox/__tests__/useEffectEvent.test.ts", + ], + rules: { + "react-hooks/rules-of-hooks": "off", + "react-hooks/exhaustive-deps": "off", + }, }, { files: ["test/vscode-tests/**/*"],