From 1e62da1088ae2e7d30858ad6baba914ceab18542 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 18 Aug 2022 14:15:52 -0700 Subject: [PATCH] Comment --- src/compiler/moduleNameResolver.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts index 9ae22a1c59c..3c65e4410bd 100644 --- a/src/compiler/moduleNameResolver.ts +++ b/src/compiler/moduleNameResolver.ts @@ -395,6 +395,7 @@ namespace ts { const pathsAreEqual = arePathsEqual(fileName, resolvedFileName, host); resolvedTypeReferenceDirective = { primary, + // If the fileName and realpath are differing only in casing prefer fileName so that we can issue correct errors for casing under forceConsistentCasingInFileNames resolvedFileName: pathsAreEqual ? fileName : resolvedFileName, originalPath: pathsAreEqual ? undefined : fileName, packageId, @@ -1409,6 +1410,7 @@ namespace ts { const path = realPath(resolvedValue.path, host, traceEnabled); const pathsAreEqual = arePathsEqual(path, resolvedValue.path, host); const originalPath = pathsAreEqual ? undefined : resolvedValue.path; + // If the path and realpath are differing only in casing prefer path so that we can issue correct errors for casing under forceConsistentCasingInFileNames resolvedValue = { ...resolvedValue, path: pathsAreEqual ? resolvedValue.path : path, originalPath }; } // For node_modules lookups, get the real path so that multiple accesses to an `npm link`-ed module do not create duplicate files.