Skip to content
PR Quorum
Sign inStart free
← Review gallery
nuxt/nuxt #35644openreviewed 6h ago

fix(nuxt): don't inject auto-imports into linked libraries

by Flo0806+70 52 filesreviewed in 47sView PR on GitHub
minor notesThe panel surfaced minor issues worth a look before merge.1 finding

Reviewer panel

Correctness
deepseek/deepseek-v4-flash
0 found
Security
deepseek/deepseek-v4-flash
0 found
Architecture
deepseek/deepseek-v4-flash
1 found

Findings

01Mmedconf 85%

isExternalId returns true for absolute paths outside layer roots even when include matches

packages/nuxt/src/imports/transform.ts:22

The include check is evaluated before the layerRoots check. If an absolute path outside all layer roots matches an include pattern, it correctly returns false. However, if the path is inside a layer root but does NOT match any include pattern, it falls through to the NODE_MODULES_RE check and returns false (correct). But if the path is outside all layer roots AND does NOT match any include pattern, it returns true — even if the path is not in node_modules. This is the intended behavior for linked libs, but the function name and comment suggest it's about "external" meaning "should not get auto-imports". The issue is that the include parameter is documented as "node_modules layers" but the function applies it to ALL paths, not just node_modules paths. This could cause a linked lib that happens to match an include pattern to incorrectly get auto-imports injected. The logic is correct for the current use case, but the semantics are confusing and fragile — if someone adds an include pattern for a non-node_modules path, it would unexpectedly affect linked libs.

Want this on your own pull requests?
The same reviewer panel runs on every PR — one focused review, no noise.
Start freeLive demo