diff --git a/eslint.config.mjs b/eslint.config.mjs index d992266ad95..c4ce0190e2f 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -48,12 +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 - { - plugins: { - 'react-hooks': reactHooksPlugin, - }, - rules: reactHooksPlugin.configs.recommended.rules, - }, + ...reactHooksPlugin.configs.recommended, { languageOptions: { globals: { diff --git a/examples/react-router-ts/package-lock.json b/examples/react-router-ts/package-lock.json index ee38df74721..899bf212942 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": "5.2.0", + "eslint-plugin-react-hooks": "6.1.1", "globals": "16.4.0", "typescript": "5.8.3", "typescript-eslint": "8.44.1", @@ -4387,13 +4387,19 @@ } }, "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": "6.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-6.1.1.tgz", + "integrity": "sha512-St9EKZzOAQF704nt2oJvAKZHjhrpg25ClQoaAlHmPZuajFldVLqRDW4VBNAS01NzeiQF0m0qhG1ZA807K6aVaQ==", "dev": true, "license": "MIT", + "dependencies": { + "@babel/core": "^7.24.4", + "@babel/parser": "^7.24.4", + "zod": "^3.22.4 || ^4.0.0", + "zod-validation-error": "^3.0.3 || ^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" @@ -8786,6 +8792,30 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "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", + "peer": true, + "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/examples/react-router-ts/package.json b/examples/react-router-ts/package.json index eb5409ac3e7..96d66727905 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": "5.2.0", + "eslint-plugin-react-hooks": "6.1.1", "globals": "16.4.0", "typescript": "5.8.3", "typescript-eslint": "8.44.1", diff --git a/examples/vite-ts/package-lock.json b/examples/vite-ts/package-lock.json index e1ef8cab152..c1697c7d0ec 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": "5.2.0", + "eslint-plugin-react-hooks": "6.1.1", "eslint-plugin-react-refresh": "0.4.22", "globals": "16.4.0", "typescript-eslint": "8.44.1", @@ -3299,13 +3299,19 @@ } }, "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": "6.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-6.1.1.tgz", + "integrity": "sha512-St9EKZzOAQF704nt2oJvAKZHjhrpg25ClQoaAlHmPZuajFldVLqRDW4VBNAS01NzeiQF0m0qhG1ZA807K6aVaQ==", "dev": true, "license": "MIT", + "dependencies": { + "@babel/core": "^7.24.4", + "@babel/parser": "^7.24.4", + "zod": "^3.22.4 || ^4.0.0", + "zod-validation-error": "^3.0.3 || ^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" @@ -6178,6 +6184,30 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "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", + "peer": true, + "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/examples/vite-ts/package.json b/examples/vite-ts/package.json index 9790841e511..a175f528bf5 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": "5.2.0", + "eslint-plugin-react-hooks": "6.1.1", "eslint-plugin-react-refresh": "0.4.22", "globals": "16.4.0", "typescript-eslint": "8.44.1", diff --git a/package.json b/package.json index 2b8fdf5dd8e..c22e71a879e 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": "5.2.0", + "eslint-plugin-react-hooks": "6.1.1", "eslint-plugin-storybook": "9.1.7", "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 eb607e2ee0e..a6230c96541 100644 --- a/patterns/navigation-layout/package-lock.json +++ b/patterns/navigation-layout/package-lock.json @@ -21,7 +21,7 @@ "@types/react-dom": "19.1.9", "@vitejs/plugin-react": "5.0.4", "eslint": "9.36.0", - "eslint-plugin-react-hooks": "5.2.0", + "eslint-plugin-react-hooks": "6.1.1", "eslint-plugin-react-refresh": "0.4.22", "globals": "16.4.0", "typescript": "5.8.3", @@ -2486,13 +2486,19 @@ } }, "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": "6.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-6.1.1.tgz", + "integrity": "sha512-St9EKZzOAQF704nt2oJvAKZHjhrpg25ClQoaAlHmPZuajFldVLqRDW4VBNAS01NzeiQF0m0qhG1ZA807K6aVaQ==", "dev": true, "license": "MIT", + "dependencies": { + "@babel/core": "^7.24.4", + "@babel/parser": "^7.24.4", + "zod": "^3.22.4 || ^4.0.0", + "zod-validation-error": "^3.0.3 || ^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" @@ -4021,6 +4027,30 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "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", + "peer": true, + "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/patterns/navigation-layout/package.json b/patterns/navigation-layout/package.json index a266f34c695..38cb8f9bb89 100644 --- a/patterns/navigation-layout/package.json +++ b/patterns/navigation-layout/package.json @@ -23,7 +23,7 @@ "@types/react-dom": "19.1.9", "@vitejs/plugin-react": "5.0.4", "eslint": "9.36.0", - "eslint-plugin-react-hooks": "5.2.0", + "eslint-plugin-react-hooks": "6.1.1", "eslint-plugin-react-refresh": "0.4.22", "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 7773ccc5c54..625e92b6aec 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": "5.2.0", + "eslint-plugin-react-hooks": "6.1.1", "eslint-plugin-react-refresh": "0.4.22", "globals": "16.4.0", "typescript": "5.8.3", @@ -3229,13 +3229,19 @@ } }, "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": "6.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-6.1.1.tgz", + "integrity": "sha512-St9EKZzOAQF704nt2oJvAKZHjhrpg25ClQoaAlHmPZuajFldVLqRDW4VBNAS01NzeiQF0m0qhG1ZA807K6aVaQ==", "dev": true, "license": "MIT", + "dependencies": { + "@babel/core": "^7.24.4", + "@babel/parser": "^7.24.4", + "zod": "^3.22.4 || ^4.0.0", + "zod-validation-error": "^3.0.3 || ^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" @@ -6013,6 +6019,30 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "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", + "peer": true, + "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/templates/vite-ts/package.json b/templates/vite-ts/package.json index 9fb22e70c84..ac9767a6a62 100644 --- a/templates/vite-ts/package.json +++ b/templates/vite-ts/package.json @@ -27,7 +27,7 @@ "@ui5/webcomponents-cypress-commands": "2.15.0", "cypress": "15.2.0", "eslint": "9.36.0", - "eslint-plugin-react-hooks": "5.2.0", + "eslint-plugin-react-hooks": "6.1.1", "eslint-plugin-react-refresh": "0.4.22", "globals": "16.4.0", "typescript": "5.8.3", diff --git a/yarn.lock b/yarn.lock index 10f9c44df04..ecb50202e94 100644 --- a/yarn.lock +++ b/yarn.lock @@ -83,7 +83,7 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:7.28.4, @babel/core@npm:^7.28.4": +"@babel/core@npm:7.28.4, @babel/core@npm:^7.24.4, @babel/core@npm:^7.28.4": version: 7.28.4 resolution: "@babel/core@npm:7.28.4" dependencies: @@ -419,25 +419,25 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.28.3": - version: 7.28.3 - resolution: "@babel/parser@npm:7.28.3" +"@babel/parser@npm:^7.24.4, @babel/parser@npm:^7.28.4": + version: 7.28.4 + resolution: "@babel/parser@npm:7.28.4" dependencies: - "@babel/types": "npm:^7.28.2" + "@babel/types": "npm:^7.28.4" bin: parser: ./bin/babel-parser.js - checksum: 10c0/1f41eb82623b0ca0f94521b57f4790c6c457cd922b8e2597985b36bdec24114a9ccf54640286a760ceb60f11fe9102d192bf60477aee77f5d45f1029b9b72729 + checksum: 10c0/58b239a5b1477ac7ed7e29d86d675cc81075ca055424eba6485872626db2dc556ce63c45043e5a679cd925e999471dba8a3ed4864e7ab1dbf64306ab72c52707 languageName: node linkType: hard -"@babel/parser@npm:^7.28.4": - version: 7.28.4 - resolution: "@babel/parser@npm:7.28.4" +"@babel/parser@npm:^7.28.3": + version: 7.28.3 + resolution: "@babel/parser@npm:7.28.3" dependencies: - "@babel/types": "npm:^7.28.4" + "@babel/types": "npm:^7.28.2" bin: parser: ./bin/babel-parser.js - checksum: 10c0/58b239a5b1477ac7ed7e29d86d675cc81075ca055424eba6485872626db2dc556ce63c45043e5a679cd925e999471dba8a3ed4864e7ab1dbf64306ab72c52707 + checksum: 10c0/1f41eb82623b0ca0f94521b57f4790c6c457cd922b8e2597985b36bdec24114a9ccf54640286a760ceb60f11fe9102d192bf60477aee77f5d45f1029b9b72729 languageName: node linkType: hard @@ -9457,12 +9457,17 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-react-hooks@npm:5.2.0": - version: 5.2.0 - resolution: "eslint-plugin-react-hooks@npm:5.2.0" +"eslint-plugin-react-hooks@npm:6.1.1": + version: 6.1.1 + resolution: "eslint-plugin-react-hooks@npm:6.1.1" + dependencies: + "@babel/core": "npm:^7.24.4" + "@babel/parser": "npm:^7.24.4" + 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/1c8d50fa5984c6dea32470651807d2922cc3934cf3425e78f84a24c2dfd972e7f019bee84aefb27e0cf2c13fea0ac1d4473267727408feeb1c56333ca1489385 + checksum: 10c0/579be053bc89c995a6c03996f9ee3f6bac88946b4b1c8b891b42f981e7c05a9c5de46324bbd2a33199855c0a602820c0e3eeb7f840730301b77a9ba3dc7a0ae2 languageName: node linkType: hard @@ -20199,7 +20204,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:5.2.0" + eslint-plugin-react-hooks: "npm:6.1.1" eslint-plugin-storybook: "npm:9.1.7" glob: "npm:11.0.3" globals: "npm:16.4.0" @@ -21688,6 +21693,22 @@ __metadata: languageName: node linkType: hard +"zod-validation-error@npm:^3.0.3 || ^4.0.0": + version: 4.0.2 + resolution: "zod-validation-error@npm:4.0.2" + peerDependencies: + zod: ^3.25.0 || ^4.0.0 + checksum: 10c0/0ccfec48c46de1be440b719cd02044d4abb89ed0e14c13e637cd55bf29102f67ccdba373f25def0fc7130e5f15025be4d557a7edcc95d5a3811599aade689e1b + languageName: node + linkType: hard + +"zod@npm:^3.22.4 || ^4.0.0": + version: 4.1.12 + resolution: "zod@npm:4.1.12" + checksum: 10c0/b64c1feb19e99d77075261eaf613e0b2be4dfcd3551eff65ad8b4f2a079b61e379854d066f7d447491fcf193f45babd8095551a9d47973d30b46b6d8e2c46774 + languageName: node + linkType: hard + "zwitch@npm:^2.0.0, zwitch@npm:^2.0.4": version: 2.0.4 resolution: "zwitch@npm:2.0.4"