[eprh] Fix config type not being exported correctly (#34746)
Another attempt to fix #34745. I updated our fixture for eslint-v9 to include running tsc. I believe there were 2 issues: 1. `export * from './cjs/eslint-plugin-react-hooks'` in npm/index.d.ts was no longer correct as we updated index.ts to export default instead of named exports 2. After fixing ^ there was a typescript error which I fixed by making some small tweaks
lauren committed
Oct 6, 2025 at 00:53 UTC
c78625842239f29ff130136fff2729fd4c7c2e91
6 files changed
+46
-95
fixtures/eslint-v9/eslint.config.ts
+1
-4
@@ -12,10 +12,7 @@ export default defineConfig([
12
},
13
},
14
},
15
- plugins: {
16
- 'react-hooks': reactHooks,
17
- },
18
- extends: ['react-hooks/recommended-latest'],
15
+ extends: [reactHooks.configs['recommended-latest']],
16
rules: {
17
'react-hooks/exhaustive-deps': 'error',
18
},
fixtures/eslint-v9/package.json
+4
-1
@@ -8,6 +8,9 @@
8
},
9
"scripts": {
10
"build": "node build.mjs && yarn",
11
- "lint": "eslint index.js --report-unused-disable-directives"
11
+ "lint": "tsc --noEmit && eslint index.js --report-unused-disable-directives"
12
+ },
13
+ "devDependencies": {
14
+ "typescript": "^5.4.3"
15
}
16
}
fixtures/eslint-v9/tsconfig.json
+18
@@ -1,2 +1,20 @@
1
{
2
+ "compilerOptions": {
3
+ "lib": [
4
+ "es2022"
5
+ ],
6
+ "module": "nodenext",
7
+ "moduleResolution": "nodenext",
8
+ "target": "es2022",
9
+ "typeRoots": [
10
+ "./node_modules/@types"
11
+ ],
12
+ "skipLibCheck": true
13
+ },
14
+ "exclude": [
15
+ "node_modules",
16
+ "**/node_modules",
17
+ "../node_modules",
18
+ "../../node_modules"
19
+ ]
20
}
fixtures/eslint-v9/yarn.lock
+14
-86
@@ -48,13 +48,6 @@
48
"@jridgewell/trace-mapping" "^0.3.28"
49
jsesc "^3.0.2"
50
51
-"@babel/helper-annotate-as-pure@^7.27.3":
52
- version "7.27.3"
53
- resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.27.3.tgz#f31fd86b915fc4daf1f3ac6976c59be7084ed9c5"
54
- integrity sha512-fXSwMQqitTGeHLBC08Eq5yXz2m37E4pJX1qAU1+2cNedz/ifv/bVXft90VeSav5nFO61EcNgwr0aJxbyPaWBPg==
55
- dependencies:
56
- "@babel/types" "^7.27.3"
57
-
51
"@babel/helper-compilation-targets@^7.27.2":
52
version "7.27.2"
53
resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz#46a0f6efab808d51d29ce96858dd10ce8732733d"
@@ -66,32 +59,11 @@
59
lru-cache "^5.1.1"
60
semver "^6.3.1"
61
69
-"@babel/helper-create-class-features-plugin@^7.18.6":
70
- version "7.28.3"
71
- resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.28.3.tgz#3e747434ea007910c320c4d39a6b46f20f371d46"
72
- integrity sha512-V9f6ZFIYSLNEbuGA/92uOvYsGCJNsuA8ESZ4ldc09bWk/j8H8TKiPw8Mk1eG6olpnO0ALHJmYfZvF4MEE4gajg==
73
- dependencies:
74
- "@babel/helper-annotate-as-pure" "^7.27.3"
75
- "@babel/helper-member-expression-to-functions" "^7.27.1"
76
- "@babel/helper-optimise-call-expression" "^7.27.1"
77
- "@babel/helper-replace-supers" "^7.27.1"
78
- "@babel/helper-skip-transparent-expression-wrappers" "^7.27.1"
79
- "@babel/traverse" "^7.28.3"
80
- semver "^6.3.1"
81
-
62
"@babel/helper-globals@^7.28.0":
63
version "7.28.0"
64
resolved "https://registry.yarnpkg.com/@babel/helper-globals/-/helper-globals-7.28.0.tgz#b9430df2aa4e17bc28665eadeae8aa1d985e6674"
65
integrity sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==
66
87
-"@babel/helper-member-expression-to-functions@^7.27.1":
88
- version "7.27.1"
89
- resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.27.1.tgz#ea1211276be93e798ce19037da6f06fbb994fa44"
90
- integrity sha512-E5chM8eWjTp/aNoVpcbfM7mLxu9XGLWYise2eBKGQomAk/Mb4XoxyqXTZbuTohbsl8EKqdlMhnDI2CCLfcs9wA==
91
- dependencies:
92
- "@babel/traverse" "^7.27.1"
93
- "@babel/types" "^7.27.1"
94
-
67
"@babel/helper-module-imports@^7.27.1":
68
version "7.27.1"
69
resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz#7ef769a323e2655e126673bb6d2d6913bbead204"
@@ -109,35 +81,6 @@
81
"@babel/helper-validator-identifier" "^7.27.1"
82
"@babel/traverse" "^7.28.3"
83
112
-"@babel/helper-optimise-call-expression@^7.27.1":
113
- version "7.27.1"
114
- resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.27.1.tgz#c65221b61a643f3e62705e5dd2b5f115e35f9200"
115
- integrity sha512-URMGH08NzYFhubNSGJrpUEphGKQwMQYBySzat5cAByY1/YgIRkULnIy3tAMeszlL/so2HbeilYloUmSpd7GdVw==
116
- dependencies:
117
- "@babel/types" "^7.27.1"
118
-
119
-"@babel/helper-plugin-utils@^7.18.6":
120
- version "7.27.1"
121
- resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz#ddb2f876534ff8013e6c2b299bf4d39b3c51d44c"
122
- integrity sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==
123
-
124
-"@babel/helper-replace-supers@^7.27.1":
125
- version "7.27.1"
126
- resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.27.1.tgz#b1ed2d634ce3bdb730e4b52de30f8cccfd692bc0"
127
- integrity sha512-7EHz6qDZc8RYS5ElPoShMheWvEgERonFCs7IAonWLLUTXW59DP14bCZt89/GKyreYn8g3S83m21FelHKbeDCKA==
128
- dependencies:
129
- "@babel/helper-member-expression-to-functions" "^7.27.1"
130
- "@babel/helper-optimise-call-expression" "^7.27.1"
131
- "@babel/traverse" "^7.27.1"
132
-
133
-"@babel/helper-skip-transparent-expression-wrappers@^7.27.1":
134
- version "7.27.1"
135
- resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.27.1.tgz#62bb91b3abba8c7f1fec0252d9dbea11b3ee7a56"
136
- integrity sha512-Tub4ZKEXqbPjXgWLl2+3JpQAYBJ8+ikpQ2Ocj/q/r0LwE3UhENh7EUabyHjz2kCEsrRY83ew2DQdHluuiDQFzg==
137
- dependencies:
138
- "@babel/traverse" "^7.27.1"
139
- "@babel/types" "^7.27.1"
140
-
84
"@babel/helper-string-parser@^7.27.1":
85
version "7.27.1"
86
resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz#54da796097ab19ce67ed9f88b47bb2ec49367687"
@@ -168,14 +111,6 @@
111
dependencies:
112
"@babel/types" "^7.28.4"
113
171
-"@babel/plugin-proposal-private-methods@^7.18.6":
172
- version "7.18.6"
173
- resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.18.6.tgz#5209de7d213457548a98436fa2882f52f4be6bea"
174
- integrity sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA==
175
- dependencies:
176
- "@babel/helper-create-class-features-plugin" "^7.18.6"
177
- "@babel/helper-plugin-utils" "^7.18.6"
178
-
114
"@babel/template@^7.27.2":
115
version "7.27.2"
116
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.27.2.tgz#fa78ceed3c4e7b63ebf6cb39e5852fca45f6809d"
@@ -198,7 +133,7 @@
133
"@babel/types" "^7.28.4"
134
debug "^4.3.1"
135
201
-"@babel/types@^7.27.1", "@babel/types@^7.27.3", "@babel/types@^7.28.2", "@babel/types@^7.28.4":
136
+"@babel/types@^7.27.1", "@babel/types@^7.28.2", "@babel/types@^7.28.4":
137
version "7.28.4"
138
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.28.4.tgz#0a4e618f4c60a7cd6c11cb2d48060e4dbe38ac3a"
139
integrity sha512-bkFqkLhh3pMBUQQkpVgWDWq/lqzc2678eUyDlTBhRqhCHFguYYGM0Efga7tYk4TogG/3x0EEl66/OQ+WGbWB/Q==
@@ -668,18 +603,6 @@ has-flag@^4.0.0:
603
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
604
integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
605
671
-hermes-estree@0.25.1:
672
- version "0.25.1"
673
- resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.25.1.tgz#6aeec17d1983b4eabf69721f3aa3eb705b17f480"
674
- integrity sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==
675
-
676
-hermes-parser@^0.25.1:
677
- version "0.25.1"
678
- resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.25.1.tgz#5be0e487b2090886c62bd8a11724cd766d5f54d1"
679
- integrity sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==
680
- dependencies:
681
- hermes-estree "0.25.1"
682
-
606
ignore@^5.2.0:
607
version "5.3.2"
608
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5"
@@ -912,6 +835,11 @@ type-check@^0.4.0, type-check@~0.4.0:
835
dependencies:
836
prelude-ls "^1.2.1"
837
838
+typescript@^5.4.3:
839
+ version "5.9.3"
840
+ resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.9.3.tgz#5b4f59e15310ab17a216f5d6cf53ee476ede670f"
841
+ integrity sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==
842
+
843
update-browserslist-db@^1.1.3:
844
version "1.1.3"
845
resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz#348377dd245216f9e7060ff50b15a1b740b75420"
@@ -949,12 +877,12 @@ yocto-queue@^0.1.0:
877
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
878
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
879
952
-zod-validation-error@^3.0.3:
953
- version "3.5.3"
954
- resolved "https://registry.yarnpkg.com/zod-validation-error/-/zod-validation-error-3.5.3.tgz#85ba33290200d8db9f043621e284f40dddefb7e5"
955
- integrity sha512-OT5Y8lbUadqVZCsnyFaTQ4/O2mys4tj7PqhdbBCp7McPwvIEKfPtdA6QfPeFQK2/Rz5LgwmAXRJTugBNBi0btw==
880
+"zod-validation-error@^3.0.3 || ^4.0.0":
881
+ version "4.0.2"
882
+ resolved "https://registry.yarnpkg.com/zod-validation-error/-/zod-validation-error-4.0.2.tgz#bc605eba49ce0fcd598c127fee1c236be3f22918"
883
+ integrity sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==
884
957
-zod@^3.22.4:
958
- version "3.25.76"
959
- resolved "https://registry.yarnpkg.com/zod/-/zod-3.25.76.tgz#26841c3f6fd22a6a2760e7ccb719179768471e34"
960
- integrity sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==
885
+"zod@^3.22.4 || ^4.0.0":
886
+ version "4.1.11"
887
+ resolved "https://registry.yarnpkg.com/zod/-/zod-4.1.11.tgz#4aab62f76cfd45e6c6166519ba31b2ea019f75f5"
888
+ integrity sha512-WPsqwxITS2tzx1bzhIKsEs19ABD5vmCVa4xBo2tq/SrV4RNZtfws1EnCWQXM6yh8bD08a1idvkB5MZSBiZsjwg==
packages/eslint-plugin-react-hooks/npm/index.d.ts
+1
-1
@@ -5,4 +5,4 @@
5
* LICENSE file in the root directory of this source tree.
6
*/
7
8
-export * from './cjs/eslint-plugin-react-hooks';
8
+export {default} from './cjs/eslint-plugin-react-hooks';
packages/eslint-plugin-react-hooks/src/index.ts
+8
-3
@@ -44,6 +44,11 @@ const allRuleConfigs: Linter.RulesRecord = {
44
...compilerRuleConfigs,
45
};
46
47
+type FlatConfig = {
48
+ plugins: Record<string, any>;
49
+ rules: Linter.RulesRecord;
50
+};
51
+
52
const plugin = {
53
meta: {
54
name: 'eslint-plugin-react-hooks',
@@ -58,9 +63,9 @@ const plugin = {
63
plugins: Array<string>;
64
rules: Linter.RulesRecord;
65
};
61
- 'flat/recommended': Array<Linter.Config>;
62
- 'recommended-latest': Array<Linter.Config>;
63
- recommended: Array<Linter.Config>;
66
+ 'flat/recommended': Array<FlatConfig>;
67
+ 'recommended-latest': Array<FlatConfig>;
68
+ recommended: Array<FlatConfig>;
69
},
70
};
71