@@ -478,7 +478,7 @@ namespace ts {
478478 }
479479 }
480480
481- function parseListTypeOption ( opt : CommandLineOptionOfListType , value : string ) : ( number | string ) [ ] {
481+ function parseListTypeOption ( opt : CommandLineOptionOfListType , value : string ) : ( string | number ) [ ] {
482482 const values = ( value || "" ) . trim ( ) . split ( "," ) ;
483483 switch ( opt . element . type ) {
484484 case "number" :
@@ -590,9 +590,9 @@ namespace ts {
590590 */
591591 export function parseJsonConfigFileContent ( json : any , host : ParseConfigHost , basePath : string , existingOptions : CompilerOptions = { } , configFileName ?: string ) : ParsedCommandLine {
592592 const errors : Diagnostic [ ] = [ ] ;
593- const compilerOptions : CompilerOptions = convertCompilerOptionsFromJson ( optionDeclarations , json [ "compilerOptions" ] , basePath , configFileName , errors ) ;
593+ const compilerOptions : CompilerOptions = convertCompilerOptionsFromJson ( optionDeclarations , json [ "compilerOptions" ] , basePath , errors , configFileName ) ;
594594 const options = extend ( existingOptions , compilerOptions ) ;
595- const typingOptions : TypingOptions = convertTypingOptionsFromJson ( typingOptionDeclarations , json [ "typingOptions" ] , basePath , configFileName , errors ) ;
595+ const typingOptions : TypingOptions = convertTypingOptionsFromJson ( typingOptionDeclarations , json [ "typingOptions" ] , basePath , errors , configFileName ) ;
596596
597597 const fileNames = getFileNames ( errors ) ;
598598
@@ -667,27 +667,27 @@ namespace ts {
667667 }
668668
669669 /* @internal */
670- export function convertCompilerOptionsFromJson ( optionsDeclarations : CommandLineOption [ ] , jsonOptions : any , basePath : string ,
671- configFileName : string , errors : Diagnostic [ ] ) : CompilerOptions {
670+ export function convertCompilerOptionsFromJson ( optionsDeclarations : CommandLineOption [ ] , jsonOptions : any ,
671+ basePath : string , errors : Diagnostic [ ] , configFileName ?: string ) : CompilerOptions {
672672
673673 const options : CompilerOptions = getBaseFileName ( configFileName ) === "jsconfig.json" ? { allowJs : true } : { } ;
674- convertOptionsFromJson < CompilerOptions > ( optionDeclarations , jsonOptions , basePath , configFileName , options , Diagnostics . Unknown_compiler_option_0 , errors ) ;
674+ convertOptionsFromJson < CompilerOptions > ( optionDeclarations , jsonOptions , basePath , options , Diagnostics . Unknown_compiler_option_0 , errors ) ;
675675 return options ;
676676 }
677677
678678 /* @internal */
679- export function convertTypingOptionsFromJson ( optionsDeclarations : CommandLineOption [ ] , jsonOptions : any , basePath : string ,
680- configFileName : string , errors : Diagnostic [ ] ) : TypingOptions {
679+ export function convertTypingOptionsFromJson ( optionsDeclarations : CommandLineOption [ ] , jsonOptions : any ,
680+ basePath : string , errors : Diagnostic [ ] , configFileName ?: string ) : TypingOptions {
681681
682682 const options : TypingOptions = getBaseFileName ( configFileName ) === "jsconfig.json"
683683 ? { enableAutoDiscovery : true , include : [ ] , exclude : [ ] }
684684 : { enableAutoDiscovery : false , include : [ ] , exclude : [ ] } ;
685- convertOptionsFromJson < TypingOptions > ( typingOptionDeclarations , jsonOptions , basePath , configFileName , options , Diagnostics . Unknown_typing_option_0 , errors ) ;
685+ convertOptionsFromJson < TypingOptions > ( typingOptionDeclarations , jsonOptions , basePath , options , Diagnostics . Unknown_typing_option_0 , errors ) ;
686686 return options ;
687687 }
688688
689689 function convertOptionsFromJson < T extends CompilerOptions | TypingOptions > ( optionDeclarations : CommandLineOption [ ] , jsonOptions : any , basePath : string ,
690- configFileName : string , defaultOptions : T , diagnosticMessage : DiagnosticMessage , errors : Diagnostic [ ] ) {
690+ defaultOptions : T , diagnosticMessage : DiagnosticMessage , errors : Diagnostic [ ] ) {
691691
692692 if ( ! jsonOptions ) {
693693 return ;
@@ -706,7 +706,7 @@ namespace ts {
706706 }
707707 }
708708
709- function convertJsonOption ( opt : CommandLineOption , value : any , basePath : string , errors : Diagnostic [ ] ) : number | string | number [ ] | string [ ] {
709+ function convertJsonOption ( opt : CommandLineOption , value : any , basePath : string , errors : Diagnostic [ ] ) : CompilerOptionsValue {
710710 const optType = opt . type ;
711711 const expectedType = typeof optType === "string" ? optType : "string" ;
712712 if ( optType === "list" && isArray ( value ) ) {
0 commit comments