Skip to content

Commit d6d9c9e

Browse files
committed
Show diagnostic when error found with --showConfig option
1 parent 608a830 commit d6d9c9e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/tsc/tsc.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,13 @@ namespace ts {
133133
if (configFileName) {
134134
const configParseResult = parseConfigFileWithSystem(configFileName, commandLineOptions, sys, reportDiagnostic)!; // TODO: GH#18217
135135
if (commandLineOptions.showConfig) {
136+
updateReportDiagnostic(configParseResult.options);
137+
configParseResult.errors.forEach(reportDiagnostic);
136138
// tslint:disable-next-line:no-null-keyword
137139
sys.write(JSON.stringify(convertToTSConfig(configParseResult, configFileName, sys), null, 4) + sys.newLine);
140+
if (configParseResult.errors.length !== 0) {
141+
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsGenerated);
142+
}
138143
return sys.exit(ExitStatus.Success);
139144
}
140145
updateReportDiagnostic(configParseResult.options);

0 commit comments

Comments
 (0)