Skip to content

Commit 9319ea4

Browse files
authored
--showConfig files list condition was inverted from what it needed to be (#28693)
* --showConfig files list condition was inverted from what it needed to be * Make no assumptions about file list normalization * accept updated, correct, baseline
1 parent 54bbf74 commit 9319ea4

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

src/compiler/commandLineParser.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,13 +1673,13 @@ namespace ts {
16731673
const files = map(
16741674
filter(
16751675
configParseResult.fileNames,
1676-
!configParseResult.configFileSpecs ? _ => false : matchesSpecs(
1676+
(!configParseResult.configFileSpecs || !configParseResult.configFileSpecs.validatedIncludeSpecs) ? _ => true : matchesSpecs(
16771677
configFileName,
16781678
configParseResult.configFileSpecs.validatedIncludeSpecs,
16791679
configParseResult.configFileSpecs.validatedExcludeSpecs
16801680
)
16811681
),
1682-
f => getRelativePathFromFile(getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), f, getCanonicalFileName)
1682+
f => getRelativePathFromFile(getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), getNormalizedAbsolutePath(f, host.getCurrentDirectory()), getCanonicalFileName)
16831683
);
16841684
const optionMap = serializeCompilerOptions(configParseResult.options, { configFilePath: getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), useCaseSensitiveFileNames: host.useCaseSensitiveFileNames });
16851685
const config = {
@@ -1713,20 +1713,20 @@ namespace ts {
17131713
}
17141714

17151715
function matchesSpecs(path: string, includeSpecs: ReadonlyArray<string> | undefined, excludeSpecs: ReadonlyArray<string> | undefined): (path: string) => boolean {
1716-
if (!includeSpecs) return _ => false;
1716+
if (!includeSpecs) return _ => true;
17171717
const patterns = getFileMatcherPatterns(path, excludeSpecs, includeSpecs, sys.useCaseSensitiveFileNames, sys.getCurrentDirectory());
17181718
const excludeRe = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, sys.useCaseSensitiveFileNames);
17191719
const includeRe = patterns.includeFilePattern && getRegexFromPattern(patterns.includeFilePattern, sys.useCaseSensitiveFileNames);
17201720
if (includeRe) {
17211721
if (excludeRe) {
1722-
return path => includeRe.test(path) && !excludeRe.test(path);
1722+
return path => !(includeRe.test(path) && !excludeRe.test(path));
17231723
}
1724-
return path => includeRe.test(path);
1724+
return path => !includeRe.test(path);
17251725
}
17261726
if (excludeRe) {
1727-
return path => !excludeRe.test(path);
1727+
return path => excludeRe.test(path);
17281728
}
1729-
return _ => false;
1729+
return _ => true;
17301730
}
17311731

17321732
function getCustomTypeMapOfCommandLineOption(optionDefinition: CommandLineOption): Map<string | number> | undefined {
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
{
2-
"compilerOptions": {}
2+
"compilerOptions": {},
3+
"files": [
4+
"./file0.st",
5+
"./file1.ts",
6+
"./file2.ts"
7+
]
38
}

0 commit comments

Comments
 (0)