@@ -638,19 +638,24 @@ function executeCommandLineWorker(
638638 if ( configFileName ) {
639639 const extendedConfigCache = new Map < string , ExtendedConfigCacheEntry > ( ) ;
640640 const configParseResult = parseConfigFileWithSystem ( configFileName , commandLineOptions , extendedConfigCache , commandLine . watchOptions , sys , reportDiagnostic ) ! ; // TODO: GH#18217
641- if ( commandLineOptions . showConfig ) {
642- if ( configParseResult . errors . length !== 0 ) {
643- reportDiagnostic = updateReportDiagnostic (
644- sys ,
645- reportDiagnostic ,
646- configParseResult . options ,
647- ) ;
648- configParseResult . errors . forEach ( reportDiagnostic ) ;
649- return sys . exit ( ExitStatus . DiagnosticsPresent_OutputsSkipped ) ;
650- }
651- // eslint-disable-next-line no-restricted-syntax
652- sys . write ( JSON . stringify ( convertToTSConfig ( configParseResult , configFileName , sys ) , null , 4 ) + sys . newLine ) ;
653- return sys . exit ( ExitStatus . Success ) ;
641+ if ( commandLineOptions . showConfig ) {
642+ // For --showConfig, filter out "no inputs found" errors since the purpose is to show configuration, not compile
643+ const errorsExcludingNoInputs = configParseResult . errors . filter ( error =>
644+ error . code !== Diagnostics . No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2 . code
645+ ) ;
646+
647+ if ( errorsExcludingNoInputs . length !== 0 ) {
648+ reportDiagnostic = updateReportDiagnostic (
649+ sys ,
650+ reportDiagnostic ,
651+ configParseResult . options ,
652+ ) ;
653+ errorsExcludingNoInputs . forEach ( reportDiagnostic ) ;
654+ return sys . exit ( ExitStatus . DiagnosticsPresent_OutputsSkipped ) ;
655+ }
656+ // eslint-disable-next-line no-restricted-syntax
657+ sys . write ( JSON . stringify ( convertToTSConfig ( configParseResult , configFileName , sys ) , null , 4 ) + sys . newLine ) ;
658+ return sys . exit ( ExitStatus . Success ) ;
654659 }
655660 reportDiagnostic = updateReportDiagnostic (
656661 sys ,
0 commit comments