Skip to content
← All reviews
nuxt/nuxt #35644 · Flo0806 · 4mo ago

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

Panel verdict

The panel surfaced minor issues worth a look before merge.

1
raised by reviewers
1
kept by the panel

Findings

MediumArchitectureconfidence 0.85

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

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.

3 reviewers · deepseek/deepseek-v4-flash · reviewed in 47s · 2 files, +70 −5

Ship the PR.
Skip the noise.

Free on 2 repositories · No credit card · Advisory only—never blocks a merge