Ignore drive letters when comparing casings of the files with forceConsistentCasingInFileNames

Fixes #31327
This commit is contained in:
Sheetal Nandi
2019-05-21 09:32:17 -07:00
parent 9052804576
commit db150517d7
3 changed files with 29 additions and 2 deletions

View File

@@ -2232,7 +2232,10 @@ namespace ts {
if (isRedirect) {
inputName = getProjectReferenceRedirect(fileName) || fileName;
}
if (getNormalizedAbsolutePath(checkedName, currentDirectory) !== getNormalizedAbsolutePath(inputName, currentDirectory)) {
// Check if it differs only in drive letters its ok to ignore that error:
const checkedAbsolutePath = getNormalizedAbsolutePathWithoutRoot(checkedName, currentDirectory);
const inputAbsolutePath = getNormalizedAbsolutePathWithoutRoot(inputName, currentDirectory);
if (checkedAbsolutePath !== inputAbsolutePath) {
reportFileNamesDifferOnlyInCasingError(inputName, checkedName, refFile, refPos, refEnd);
}
}