diff --git a/eslint.config.mjs b/eslint.config.mjs index c4ce0190e2f..119d9be249a 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -48,7 +48,7 @@ const config = tseslint.config( reactPlugin.configs.flat.recommended, // This is not a plugin object, but a shareable config object reactPlugin.configs.flat['jsx-runtime'], // Add this if you are using React 17+ // eslint-plugin-react-hooks - ...reactHooksPlugin.configs.recommended, + reactHooksPlugin.configs.flat.recommended, { languageOptions: { globals: { diff --git a/examples/react-router-ts/package-lock.json b/examples/react-router-ts/package-lock.json index 7c0a78f4655..2364ebc8c78 100644 --- a/examples/react-router-ts/package-lock.json +++ b/examples/react-router-ts/package-lock.json @@ -27,7 +27,7 @@ "eslint-plugin-import": "2.32.0", "eslint-plugin-jsx-a11y": "6.10.2", "eslint-plugin-react": "7.37.5", - "eslint-plugin-react-hooks": "6.1.1", + "eslint-plugin-react-hooks": "7.0.0", "globals": "16.4.0", "typescript": "5.8.3", "typescript-eslint": "8.44.1", @@ -4387,14 +4387,15 @@ } }, "node_modules/eslint-plugin-react-hooks": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-6.1.1.tgz", - "integrity": "sha512-St9EKZzOAQF704nt2oJvAKZHjhrpg25ClQoaAlHmPZuajFldVLqRDW4VBNAS01NzeiQF0m0qhG1ZA807K6aVaQ==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.0.0.tgz", + "integrity": "sha512-fNXaOwvKwq2+pXiRpXc825Vd63+KM4DLL40Rtlycb8m7fYpp6efrTp1sa6ZbP/Ap58K2bEKFXRmhURE+CJAQWw==", "dev": true, "license": "MIT", "dependencies": { "@babel/core": "^7.24.4", "@babel/parser": "^7.24.4", + "hermes-parser": "^0.25.1", "zod": "^3.22.4 || ^4.0.0", "zod-validation-error": "^3.0.3 || ^4.0.0" }, @@ -5177,6 +5178,23 @@ "node": ">= 0.4" } }, + "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/hosted-git-info": { "version": "6.1.3", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.3.tgz", diff --git a/examples/react-router-ts/package.json b/examples/react-router-ts/package.json index a3c2e87a9b4..847333363d3 100644 --- a/examples/react-router-ts/package.json +++ b/examples/react-router-ts/package.json @@ -32,7 +32,7 @@ "eslint-plugin-import": "2.32.0", "eslint-plugin-jsx-a11y": "6.10.2", "eslint-plugin-react": "7.37.5", - "eslint-plugin-react-hooks": "6.1.1", + "eslint-plugin-react-hooks": "7.0.0", "globals": "16.4.0", "typescript": "5.8.3", "typescript-eslint": "8.44.1", diff --git a/examples/vite-ts/eslint.config.mjs b/examples/vite-ts/eslint.config.mjs index cfd81c9345d..47a84020368 100644 --- a/examples/vite-ts/eslint.config.mjs +++ b/examples/vite-ts/eslint.config.mjs @@ -7,18 +7,16 @@ import tseslint from 'typescript-eslint'; export default tseslint.config( { ignores: ['dist'] }, { - extends: [js.configs.recommended, ...tseslint.configs.recommended], + extends: [js.configs.recommended, ...tseslint.configs.recommended, reactHooks.configs.flat.recommended, ], files: ['**/*.{ts,tsx}'], languageOptions: { ecmaVersion: 2020, globals: globals.browser, }, plugins: { - 'react-hooks': reactHooks, 'react-refresh': reactRefresh, }, rules: { - ...reactHooks.configs.recommended.rules, 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], }, }, diff --git a/examples/vite-ts/package-lock.json b/examples/vite-ts/package-lock.json index eadaaf54c94..2a86c4f69a5 100644 --- a/examples/vite-ts/package-lock.json +++ b/examples/vite-ts/package-lock.json @@ -24,7 +24,7 @@ "@vitejs/plugin-react": "5.0.4", "cypress": "15.2.0", "eslint": "9.36.0", - "eslint-plugin-react-hooks": "6.1.1", + "eslint-plugin-react-hooks": "7.0.0", "eslint-plugin-react-refresh": "0.4.23", "globals": "16.4.0", "typescript-eslint": "8.44.1", @@ -3299,14 +3299,15 @@ } }, "node_modules/eslint-plugin-react-hooks": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-6.1.1.tgz", - "integrity": "sha512-St9EKZzOAQF704nt2oJvAKZHjhrpg25ClQoaAlHmPZuajFldVLqRDW4VBNAS01NzeiQF0m0qhG1ZA807K6aVaQ==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.0.0.tgz", + "integrity": "sha512-fNXaOwvKwq2+pXiRpXc825Vd63+KM4DLL40Rtlycb8m7fYpp6efrTp1sa6ZbP/Ap58K2bEKFXRmhURE+CJAQWw==", "dev": true, "license": "MIT", "dependencies": { "@babel/core": "^7.24.4", "@babel/parser": "^7.24.4", + "hermes-parser": "^0.25.1", "zod": "^3.22.4 || ^4.0.0", "zod-validation-error": "^3.0.3 || ^4.0.0" }, @@ -3962,6 +3963,23 @@ "node": ">= 0.4" } }, + "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/http-signature": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.4.0.tgz", diff --git a/examples/vite-ts/package.json b/examples/vite-ts/package.json index 41eae775987..c008a60ed45 100644 --- a/examples/vite-ts/package.json +++ b/examples/vite-ts/package.json @@ -30,7 +30,7 @@ "@vitejs/plugin-react": "5.0.4", "cypress": "15.2.0", "eslint": "9.36.0", - "eslint-plugin-react-hooks": "6.1.1", + "eslint-plugin-react-hooks": "7.0.0", "eslint-plugin-react-refresh": "0.4.23", "globals": "16.4.0", "typescript-eslint": "8.44.1", diff --git a/package.json b/package.json index f98068fb666..c1597ea2c92 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "eslint-plugin-no-only-tests": "3.3.0", "eslint-plugin-prettier": "5.5.4", "eslint-plugin-react": "7.37.5", - "eslint-plugin-react-hooks": "6.1.1", + "eslint-plugin-react-hooks": "7.0.0", "eslint-plugin-storybook": "9.1.10", "glob": "11.0.3", "globals": "16.4.0", diff --git a/patterns/navigation-layout/package-lock.json b/patterns/navigation-layout/package-lock.json index e1ef792873e..4a9d4486df3 100644 --- a/patterns/navigation-layout/package-lock.json +++ b/patterns/navigation-layout/package-lock.json @@ -21,7 +21,7 @@ "@types/react-dom": "19.1.11", "@vitejs/plugin-react": "5.0.4", "eslint": "9.36.0", - "eslint-plugin-react-hooks": "6.1.1", + "eslint-plugin-react-hooks": "7.0.0", "eslint-plugin-react-refresh": "0.4.23", "globals": "16.4.0", "typescript": "5.8.3", @@ -2486,14 +2486,15 @@ } }, "node_modules/eslint-plugin-react-hooks": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-6.1.1.tgz", - "integrity": "sha512-St9EKZzOAQF704nt2oJvAKZHjhrpg25ClQoaAlHmPZuajFldVLqRDW4VBNAS01NzeiQF0m0qhG1ZA807K6aVaQ==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.0.0.tgz", + "integrity": "sha512-fNXaOwvKwq2+pXiRpXc825Vd63+KM4DLL40Rtlycb8m7fYpp6efrTp1sa6ZbP/Ap58K2bEKFXRmhURE+CJAQWw==", "dev": true, "license": "MIT", "dependencies": { "@babel/core": "^7.24.4", "@babel/parser": "^7.24.4", + "hermes-parser": "^0.25.1", "zod": "^3.22.4 || ^4.0.0", "zod-validation-error": "^3.0.3 || ^4.0.0" }, @@ -2841,6 +2842,23 @@ "node": ">=8" } }, + "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/ignore": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", diff --git a/patterns/navigation-layout/package.json b/patterns/navigation-layout/package.json index 225282cc29f..524891b3f45 100644 --- a/patterns/navigation-layout/package.json +++ b/patterns/navigation-layout/package.json @@ -23,7 +23,7 @@ "@types/react-dom": "19.1.11", "@vitejs/plugin-react": "5.0.4", "eslint": "9.36.0", - "eslint-plugin-react-hooks": "6.1.1", + "eslint-plugin-react-hooks": "7.0.0", "eslint-plugin-react-refresh": "0.4.23", "globals": "16.4.0", "typescript": "5.8.3", diff --git a/templates/vite-ts/package-lock.json b/templates/vite-ts/package-lock.json index ca4e7cfb44a..bfa63e5fee6 100644 --- a/templates/vite-ts/package-lock.json +++ b/templates/vite-ts/package-lock.json @@ -23,7 +23,7 @@ "@vitejs/plugin-react": "5.0.4", "cypress": "15.2.0", "eslint": "9.36.0", - "eslint-plugin-react-hooks": "6.1.1", + "eslint-plugin-react-hooks": "7.0.0", "eslint-plugin-react-refresh": "0.4.23", "globals": "16.4.0", "typescript": "5.8.3", @@ -3229,14 +3229,15 @@ } }, "node_modules/eslint-plugin-react-hooks": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-6.1.1.tgz", - "integrity": "sha512-St9EKZzOAQF704nt2oJvAKZHjhrpg25ClQoaAlHmPZuajFldVLqRDW4VBNAS01NzeiQF0m0qhG1ZA807K6aVaQ==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.0.0.tgz", + "integrity": "sha512-fNXaOwvKwq2+pXiRpXc825Vd63+KM4DLL40Rtlycb8m7fYpp6efrTp1sa6ZbP/Ap58K2bEKFXRmhURE+CJAQWw==", "dev": true, "license": "MIT", "dependencies": { "@babel/core": "^7.24.4", "@babel/parser": "^7.24.4", + "hermes-parser": "^0.25.1", "zod": "^3.22.4 || ^4.0.0", "zod-validation-error": "^3.0.3 || ^4.0.0" }, @@ -3916,6 +3917,23 @@ "node": ">= 0.4" } }, + "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/http-signature": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.4.0.tgz", diff --git a/templates/vite-ts/package.json b/templates/vite-ts/package.json index 852cb0a68b4..564f3b64ddd 100644 --- a/templates/vite-ts/package.json +++ b/templates/vite-ts/package.json @@ -27,7 +27,7 @@ "@ui5/webcomponents-cypress-commands": "2.15.2", "cypress": "15.2.0", "eslint": "9.36.0", - "eslint-plugin-react-hooks": "6.1.1", + "eslint-plugin-react-hooks": "7.0.0", "eslint-plugin-react-refresh": "0.4.23", "globals": "16.4.0", "typescript": "5.8.3", diff --git a/yarn.lock b/yarn.lock index ae73b38298a..8201529f44e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9473,17 +9473,18 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-react-hooks@npm:6.1.1": - version: 6.1.1 - resolution: "eslint-plugin-react-hooks@npm:6.1.1" +"eslint-plugin-react-hooks@npm:7.0.0": + version: 7.0.0 + resolution: "eslint-plugin-react-hooks@npm:7.0.0" dependencies: "@babel/core": "npm:^7.24.4" "@babel/parser": "npm:^7.24.4" + hermes-parser: "npm:^0.25.1" zod: "npm:^3.22.4 || ^4.0.0" zod-validation-error: "npm:^3.0.3 || ^4.0.0" peerDependencies: eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 - checksum: 10c0/579be053bc89c995a6c03996f9ee3f6bac88946b4b1c8b891b42f981e7c05a9c5de46324bbd2a33199855c0a602820c0e3eeb7f840730301b77a9ba3dc7a0ae2 + checksum: 10c0/911c9efdd9b102ce2eabac247dff8c217ecb8d6972aaf3b7eecfb1cfc293d4d902766355993ff7a37a33c0abde3e76971f43bc1c8ff36d6c123310e5680d0423 languageName: node linkType: hard @@ -11338,6 +11339,22 @@ __metadata: languageName: node linkType: hard +"hermes-estree@npm:0.25.1": + version: 0.25.1 + resolution: "hermes-estree@npm:0.25.1" + checksum: 10c0/48be3b2fa37a0cbc77a112a89096fa212f25d06de92781b163d67853d210a8a5c3784fac23d7d48335058f7ed283115c87b4332c2a2abaaccc76d0ead1a282ac + languageName: node + linkType: hard + +"hermes-parser@npm:^0.25.1": + version: 0.25.1 + resolution: "hermes-parser@npm:0.25.1" + dependencies: + hermes-estree: "npm:0.25.1" + checksum: 10c0/3abaa4c6f1bcc25273f267297a89a4904963ea29af19b8e4f6eabe04f1c2c7e9abd7bfc4730ddb1d58f2ea04b6fee74053d8bddb5656ec6ebf6c79cc8d14202c + languageName: node + linkType: hard + "highlight.js@npm:^11.6.0": version: 11.10.0 resolution: "highlight.js@npm:11.10.0" @@ -20220,7 +20237,7 @@ __metadata: eslint-plugin-no-only-tests: "npm:3.3.0" eslint-plugin-prettier: "npm:5.5.4" eslint-plugin-react: "npm:7.37.5" - eslint-plugin-react-hooks: "npm:6.1.1" + eslint-plugin-react-hooks: "npm:7.0.0" eslint-plugin-storybook: "npm:9.1.10" glob: "npm:11.0.3" globals: "npm:16.4.0"