@@ -1583,11 +1583,11 @@ namespace ts {
15831583 function emitWorker ( program : Program , sourceFile : SourceFile | undefined , writeFileCallback : WriteFileCallback | undefined , cancellationToken : CancellationToken | undefined , emitOnlyDtsFiles ?: boolean , customTransformers ?: CustomTransformers , forceDtsEmit ?: boolean ) : EmitResult {
15841584 let declarationDiagnostics : readonly Diagnostic [ ] = [ ] ;
15851585
1586- if ( options . listFilesOnly || ( ! forceDtsEmit && shouldSuppressEmit ( options ) ) ) {
1587- return { diagnostics : declarationDiagnostics , sourceMaps : undefined , emittedFiles : undefined , emitSkipped : true } ;
1588- }
1589-
15901586 if ( ! forceDtsEmit ) {
1587+ if ( options . noEmit ) {
1588+ return { diagnostics : declarationDiagnostics , sourceMaps : undefined , emittedFiles : undefined , emitSkipped : true } ;
1589+ }
1590+
15911591 // If the noEmitOnError flag is set, then check if we have any errors so far. If so,
15921592 // immediately bail out. Note that we pass 'undefined' for 'sourceFile' so that we
15931593 // get any preEmit diagnostics, not just the ones
@@ -2037,9 +2037,7 @@ namespace ts {
20372037 }
20382038
20392039 function getGlobalDiagnostics ( ) : SortedReadonlyArray < Diagnostic > {
2040- return ! options . listFilesOnly && rootNames . length
2041- ? sortAndDeduplicateDiagnostics ( getDiagnosticsProducingTypeChecker ( ) . getGlobalDiagnostics ( ) . slice ( ) )
2042- : emptyArray as any as SortedReadonlyArray < Diagnostic > ;
2040+ return rootNames . length ? sortAndDeduplicateDiagnostics ( getDiagnosticsProducingTypeChecker ( ) . getGlobalDiagnostics ( ) . slice ( ) ) : emptyArray as any as SortedReadonlyArray < Diagnostic > ;
20432041 }
20442042
20452043 function getConfigFileParsingDiagnostics ( ) : readonly Diagnostic [ ] {
@@ -3092,7 +3090,7 @@ namespace ts {
30923090 createDiagnosticForOptionName ( Diagnostics . Option_0_cannot_be_specified_without_specifying_option_1_or_option_2 , "emitDeclarationOnly" , "declaration" , "composite" ) ;
30933091 }
30943092
3095- if ( shouldSuppressEmit ( options ) ) {
3093+ if ( options . noEmit ) {
30963094 createDiagnosticForOptionName ( Diagnostics . Option_0_cannot_be_specified_with_option_1 , "emitDeclarationOnly" , "noEmit" ) ;
30973095 }
30983096 }
@@ -3115,7 +3113,7 @@ namespace ts {
31153113 }
31163114
31173115 // If the emit is enabled make sure that every output file is unique and not overwriting any of the input files
3118- if ( ! shouldSuppressEmit ( options ) && ! options . suppressOutputPathCheck ) {
3116+ if ( ! options . noEmit && ! options . suppressOutputPathCheck ) {
31193117 const emitHost = getEmitHost ( ) ;
31203118 const emitFilesSeen = createMap < true > ( ) ;
31213119 forEachEmittedFile ( emitHost , ( emitFileNames ) => {
@@ -3184,7 +3182,7 @@ namespace ts {
31843182 }
31853183
31863184 function verifyProjectReferences ( ) {
3187- const buildInfoPath = ! shouldSuppressEmit ( options ) && ! options . suppressOutputPathCheck ? getTsBuildInfoEmitOutputFilePath ( options ) : undefined ;
3185+ const buildInfoPath = ! options . noEmit && ! options . suppressOutputPathCheck ? getTsBuildInfoEmitOutputFilePath ( options ) : undefined ;
31883186 forEachProjectReference ( projectReferences , resolvedProjectReferences , ( resolvedRef , index , parent ) => {
31893187 const ref = ( parent ? parent . commandLine . projectReferences : projectReferences ) ! [ index ] ;
31903188 const parentFile = parent && parent . sourceFile as JsonSourceFile ;
@@ -3325,7 +3323,7 @@ namespace ts {
33253323 }
33263324
33273325 function isEmittedFile ( file : string ) : boolean {
3328- if ( shouldSuppressEmit ( options ) ) {
3326+ if ( options . noEmit ) {
33293327 return false ;
33303328 }
33313329
0 commit comments