Skip to content

Commit c2898db

Browse files
Merge pull request #28612 from vvakame/feat-showConfig-error
show diagnostic when error occurred with --showConfig
2 parents 34d9d4b + d8ac9c1 commit c2898db

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,6 +133,11 @@ namespace ts {
133133
if (configFileName) {
134134
const configParseResult = parseConfigFileWithSystem(configFileName, commandLineOptions, sys, reportDiagnostic)!; // TODO: GH#18217
135135
if (commandLineOptions.showConfig) {
136+
if (configParseResult.errors.length !== 0) {
137+
updateReportDiagnostic(configParseResult.options);
138+
configParseResult.errors.forEach(reportDiagnostic);
139+
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped);
140+
}
136141
// tslint:disable-next-line:no-null-keyword
137142
sys.write(JSON.stringify(convertToTSConfig(configParseResult, configFileName, sys), null, 4) + sys.newLine);
138143
return sys.exit(ExitStatus.Success);

0 commit comments

Comments
 (0)