Skip to content

Commit a00374d

Browse files
committed
Exclude outDir and declarationDir even if they come from extended config
Fixes #58327
1 parent 8cf464e commit a00374d

7 files changed

+13
-12
lines changed

src/compiler/commandLineParser.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -2976,12 +2976,12 @@ function parseJsonConfigFileContentWorker(
29762976
const excludeOfRaw = getSpecsFromRaw("exclude");
29772977
let isDefaultIncludeSpec = false;
29782978
let excludeSpecs = toPropValue(excludeOfRaw);
2979-
if (excludeOfRaw === "no-prop" && raw.compilerOptions) {
2980-
const outDir = raw.compilerOptions.outDir;
2981-
const declarationDir = raw.compilerOptions.declarationDir;
2979+
if (excludeOfRaw === "no-prop") {
2980+
const outDir = options.outDir;
2981+
const declarationDir = options.declarationDir;
29822982

29832983
if (outDir || declarationDir) {
2984-
excludeSpecs = [outDir, declarationDir].filter(d => !!d);
2984+
excludeSpecs = filter([outDir, declarationDir], d => !!d) as string[];
29852985
}
29862986
}
29872987

tests/baselines/reference/config/showConfig/Show TSConfig with paths and more/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
"./src/**/*"
3333
],
3434
"exclude": [
35-
"./lib"
35+
"/Show TSConfig with paths and more/lib"
3636
]
3737
}

tests/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with json api.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ configFileName:: /apath/tsconfig.json
1515
FileNames::
1616

1717
Errors::
18-
[91merror[0m[90m TS18003: [0mNo inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["./"]'.
18+
[91merror[0m[90m TS18003: [0mNo inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["/apath"]'.
1919

tests/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with jsonSourceFile api.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ configFileName:: /apath/tsconfig.json
1515
FileNames::
1616

1717
Errors::
18-
[91merror[0m[90m TS18003: [0mNo inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["./"]'.
18+
[91merror[0m[90m TS18003: [0mNo inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["/apath"]'.
1919

tests/baselines/reference/config/tsconfigParsing/with outDir from base tsconfig with json api.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Fs::
2020

2121
configFileName:: tsconfig.json
2222
FileNames::
23-
/b.ts,/bin/a.ts
23+
/b.ts
2424
Errors::
2525

2626

@@ -46,6 +46,6 @@ Fs::
4646

4747
configFileName:: tsconfig.json
4848
FileNames::
49-
/b.ts,/bin/a.ts
49+
/b.ts
5050
Errors::
5151

tests/baselines/reference/config/tsconfigParsing/with outDir from base tsconfig with jsonSourceFile api.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Fs::
2020

2121
configFileName:: tsconfig.json
2222
FileNames::
23-
/b.ts,/bin/a.ts
23+
/b.ts
2424
Errors::
2525

2626

@@ -46,6 +46,6 @@ Fs::
4646

4747
configFileName:: tsconfig.json
4848
FileNames::
49-
/b.ts,/bin/a.ts
49+
/b.ts
5050
Errors::
5151

tests/baselines/reference/tsc/extends/configDir-template-showConfig.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ Output::
136136
"/home/src/projects/myproject/src"
137137
],
138138
"exclude": [
139-
"outDir"
139+
"/home/src/projects/myproject/outDir",
140+
"/home/src/projects/myproject/decls"
140141
]
141142
}
142143
exitCode:: ExitStatus.Success

0 commit comments

Comments
 (0)