diff --git a/packages/eslint-config-next/index.js b/packages/eslint-config-next/index.js index 8b39fd38974fa4..e5fe9ef7201d2b 100644 --- a/packages/eslint-config-next/index.js +++ b/packages/eslint-config-next/index.js @@ -34,6 +34,7 @@ const hookPropertyMap = new Map( 'eslint-plugin-import', 'eslint-plugin-react', 'eslint-plugin-jsx-a11y', + 'eslint-plugin-react-hooks', ].map((request) => [ request, require.resolve(request, { paths: sortedPaths }), @@ -55,7 +56,7 @@ require('@rushstack/eslint-patch/modern-module-resolution') module.exports = { extends: [ 'plugin:react/recommended', - 'plugin:react-hooks/recommended', + 'plugin:react-hooks/recommended-latest-legacy', 'plugin:@next/next/recommended-legacy', ], plugins: ['import', 'react', 'jsx-a11y'], diff --git a/packages/eslint-config-next/package.json b/packages/eslint-config-next/package.json index 70934ab2913cd9..2620fbb71ae4ed 100644 --- a/packages/eslint-config-next/package.json +++ b/packages/eslint-config-next/package.json @@ -19,7 +19,7 @@ "eslint-plugin-import": "^2.31.0", "eslint-plugin-jsx-a11y": "^6.10.0", "eslint-plugin-react": "^7.37.0", - "eslint-plugin-react-hooks": "^5.0.0" + "eslint-plugin-react-hooks": "^6.1.1" }, "peerDependencies": { "eslint": "^7.23.0 || ^8.0.0 || ^9.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ac48872b5eb9f8..17729985de989b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -929,8 +929,8 @@ importers: specifier: ^7.37.0 version: 7.37.1(eslint@9.12.0(jiti@2.5.1)) eslint-plugin-react-hooks: - specifier: ^5.0.0 - version: 5.0.0(eslint@9.12.0(jiti@2.5.1)) + specifier: ^6.1.1 + version: 6.1.1(eslint@9.12.0(jiti@2.5.1)) typescript: specifier: '>=3.3.1' version: 5.6.3 @@ -9302,6 +9302,12 @@ packages: peerDependencies: eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 + eslint-plugin-react-hooks@6.1.1: + resolution: {integrity: sha512-St9EKZzOAQF704nt2oJvAKZHjhrpg25ClQoaAlHmPZuajFldVLqRDW4VBNAS01NzeiQF0m0qhG1ZA807K6aVaQ==} + engines: {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 + eslint-plugin-react@7.35.0: resolution: {integrity: sha512-v501SSMOWv8gerHkk+IIQBkcGRGrO2nfybfj5pLxuJNFTPxxA3PSryhXTK+9pNbtkggheDdsC0E9Q8CuPk6JKA==} engines: {node: '>=4'} @@ -27076,6 +27082,16 @@ snapshots: dependencies: eslint: 9.12.0(jiti@2.5.1) + eslint-plugin-react-hooks@6.1.1(eslint@9.12.0(jiti@2.5.1)): + dependencies: + '@babel/core': 7.26.10 + '@babel/parser': 7.27.0 + eslint: 9.12.0(jiti@2.5.1) + zod: 3.25.76 + zod-validation-error: 3.4.0(zod@3.25.76) + transitivePeerDependencies: + - supports-color + eslint-plugin-react@7.35.0(eslint@9.12.0(jiti@2.5.1)): dependencies: array-includes: 3.1.8