Skip to content

Commit 83be5c2

Browse files
committed
fix: skip node_modules resolutions in tsconfig alias check
When check_import_as_tsconfig_path_alias resolves an import to a path inside node_modules, return false so the caller falls through to check_package_import for proper dependency validation.
1 parent 4a5551d commit 83be5c2

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

crates/turborepo-boundaries/src/imports.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ fn check_import_as_tsconfig_path_alias(
118118
match resolver.resolve(dir, import) {
119119
Ok(resolution) => {
120120
let path = resolution.path();
121+
// If the import resolved to a path inside node_modules, it is a
122+
// real package import — not a tsconfig alias. Return false so the
123+
// caller falls through to `check_package_import`.
124+
if path.components().any(|c| c.as_os_str() == "node_modules") {
125+
return Ok(false);
126+
}
121127
let Some(utf8_path) = Utf8Path::from_path(path) else {
122128
result.diagnostics.push(BoundariesDiagnostic::InvalidPath {
123129
path: path.to_string_lossy().to_string(),

0 commit comments

Comments
 (0)