Skip to content

Commit 426e8dc

Browse files
committed
Clarify global typings cache exclusion in reachability comment
1 parent a5aa6a8 commit 426e8dc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎tsc/internal/modulespecifiers/specifiers.go‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,8 @@ func tryGetModuleNameAsNodeModule(
761761
globalTypingsCacheLocation := host.GetGlobalTypingsCacheLocation()
762762
// Check reachability before consulting package.json exports, which can return
763763
// a bare specifier directly. An exported path is only usable if the importing
764-
// file can reach the package through node_modules.
764+
// file can reach the package through node_modules, and packages under the
765+
// global typings cache are excluded.
765766
if !caseSensitivity.ContainsPath(parts.TopLevelNodeModulesSearchRoot, info.SourceDirectory.AsPath()) ||
766767
globalTypingsCacheLocation != "" && caseSensitivity.ContainsPath(parts.TopLevelNodeModulesSearchRoot, globalTypingsCacheLocation.AsPath()) {
767768
return ""

0 commit comments

Comments
 (0)