Fix file matching with tsx and dts of same name are included by include patterns (#55690)

This commit is contained in:
Sheetal Nandi
2023-09-12 13:10:34 -07:00
committed by GitHub
parent 3bc41784f0
commit 3ade5022d7
18 changed files with 1254 additions and 2 deletions
+4 -1
View File
@@ -3849,7 +3849,10 @@ function hasFileWithHigherPriorityExtension(file: string, literalFiles: Map<stri
return false;
}
for (const ext of extensionGroup) {
if (fileExtensionIs(file, ext)) {
// d.ts files match with .ts extension and with case sensitive sorting the file order for same files with ts tsx and dts extension is
// d.ts, .ts, .tsx in that order so we need to handle tsx and dts of same same name case here and in remove files with same extensions
// So dont match .d.ts files with .ts extension
if (fileExtensionIs(file, ext) && (ext !== Extension.Ts || !fileExtensionIs(file, Extension.Dts))) {
return false;
}
const higherPriorityPath = keyMapper(changeExtension(file, ext));