Platform independent wildcard file include ordering (#22393)

* Resolve config wildcards result order in a platform independent manner

* Accept affected user test baseline

* Per reccomendation, just change matchFiles

* Add test asserting the same order on differing case sensitive platforms
This commit is contained in:
Wesley Wigham
2018-03-07 19:54:19 -08:00
committed by GitHub
parent 45eaf42006
commit 88ba1ef2de
3 changed files with 36 additions and 5 deletions

View File

@@ -2539,7 +2539,6 @@ namespace ts {
path = normalizePath(path);
currentDirectory = normalizePath(currentDirectory);
const comparer = useCaseSensitiveFileNames ? compareStringsCaseSensitive : compareStringsCaseInsensitive;
const patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
const regexFlag = useCaseSensitiveFileNames ? "" : "i";
@@ -2560,7 +2559,7 @@ namespace ts {
function visitDirectory(path: string, absolutePath: string, depth: number | undefined) {
const { files, directories } = getFileSystemEntries(path);
for (const current of sort(files, comparer)) {
for (const current of sort(files, compareStringsCaseSensitive)) {
const name = combinePaths(path, current);
const absoluteName = combinePaths(absolutePath, current);
if (extensions && !fileExtensionIsOneOf(name, extensions)) continue;
@@ -2583,7 +2582,7 @@ namespace ts {
}
}
for (const current of sort(directories, comparer)) {
for (const current of sort(directories, compareStringsCaseSensitive)) {
const name = combinePaths(path, current);
const absoluteName = combinePaths(absolutePath, current);
if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) &&