Skip to content

Commit c038a5a

Browse files
committed
fix(build): unblock eslint-plugin-react-hooks Rollup bundle
- Add @types/babel__code-frame so @rollup/plugin-typescript can typecheck imports of @babel/code-frame during the monorepo build. - Honor bundle.preferBuiltins in @rollup/plugin-node-resolve so Node built-ins (e.g. tty, os) resolve correctly for the hooks ESLint plugin; bundles.js already sets preferBuiltins: true for that package.
1 parent d1727fb commit c038a5a

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

packages/eslint-plugin-react-hooks/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"@types/estree": "^1.0.6",
5555
"@types/estree-jsx": "^1.0.5",
5656
"@types/node": "^20.2.5",
57+
"@types/babel__code-frame": "^7.0.6",
5758
"@typescript-eslint/parser-v2": "npm:@typescript-eslint/parser@^2.26.0",
5859
"@typescript-eslint/parser-v3": "npm:@typescript-eslint/parser@^3.10.0",
5960
"@typescript-eslint/parser-v4": "npm:@typescript-eslint/parser@^4.1.0",

scripts/rollup/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ function getPlugins(
403403
// Use Node resolution mechanism.
404404
resolve({
405405
// `external` rollup config takes care of marking builtins as externals
406-
preferBuiltins: false,
406+
preferBuiltins: bundle.preferBuiltins === true,
407407
}),
408408
// Remove license headers from individual modules
409409
stripBanner({

yarn.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3824,6 +3824,11 @@
38243824
resolved "https://registry.yarnpkg.com/@tsconfig/strictest/-/strictest-2.0.5.tgz#2cbc67f207ba87fdec2a84ad79b1708cf4edd93b"
38253825
integrity sha512-ec4tjL2Rr0pkZ5hww65c+EEPYwxOi4Ryv+0MtjeaSQRJyq322Q27eOQiFbuNgw2hpL4hB1/W/HBGk3VKS43osg==
38263826

3827+
"@types/babel__code-frame@^7.0.6":
3828+
version "7.27.0"
3829+
resolved "https://registry.yarnpkg.com/@types/babel__code-frame/-/babel__code-frame-7.27.0.tgz#4799f597ec9e7bbdd39e1374f43423742dcffa99"
3830+
integrity sha512-Dwlo+LrxDx/0SpfmJ/BKveHf7QXWvLBLc+x03l5sbzykj3oB9nHygCpSECF1a+s+QIxbghe+KHqC90vGtxLRAA==
3831+
38273832
"@types/babel__core@^7.1.14":
38283833
version "7.20.5"
38293834
resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017"
@@ -8167,6 +8172,7 @@ eslint-plugin-no-unsanitized@4.0.2:
81678172

81688173
"eslint-plugin-react-internal@link:./scripts/eslint-rules":
81698174
version "0.0.0"
8175+
uid ""
81708176

81718177
eslint-plugin-react@^6.7.1:
81728178
version "6.10.3"

0 commit comments

Comments
 (0)