11import {
2+ addToSeen ,
23 AlternateModeDiagnostics ,
34 append ,
45 arrayFrom ,
@@ -2629,7 +2630,7 @@ export function convertToTSConfig(configParseResult: ParsedCommandLine, configFi
26292630 const providedKeys = new Set ( optionMap . keys ( ) ) ;
26302631 const impliedCompilerOptions : Record < string , CompilerOptionsValue > = { } ;
26312632 for ( const option in computedOptions ) {
2632- if ( ! providedKeys . has ( option ) && some ( computedOptions [ option ] . dependencies , dep => providedKeys . has ( dep ) ) ) {
2633+ if ( ! providedKeys . has ( option ) && optionDependsOn ( option , providedKeys ) ) {
26332634 const implied = computedOptions [ option ] . computeValue ( configParseResult . options ) ;
26342635 const defaultValue = computedOptions [ option ] . computeValue ( { } ) ;
26352636 if ( implied !== defaultValue ) {
@@ -2641,6 +2642,18 @@ export function convertToTSConfig(configParseResult: ParsedCommandLine, configFi
26412642 return config ;
26422643}
26432644
2645+ function optionDependsOn ( option : string , dependsOn : Set < string > ) : boolean {
2646+ const seen = new Set < string > ( ) ;
2647+ return optionDependsOnRecursive ( option ) ;
2648+
2649+ function optionDependsOnRecursive ( option : string ) : boolean {
2650+ if ( addToSeen ( seen , option ) ) {
2651+ return some ( computedOptions [ option ] ?. dependencies , dep => dependsOn . has ( dep ) || optionDependsOnRecursive ( dep ) ) ;
2652+ }
2653+ return false ;
2654+ }
2655+ }
2656+
26442657/** @internal */
26452658export function optionMapToObject ( optionMap : Map < string , CompilerOptionsValue > ) : object {
26462659 return Object . fromEntries ( optionMap ) ;
0 commit comments