@@ -98,7 +98,6 @@ import {
9898 PrefixUnaryExpression ,
9999 ProjectReference ,
100100 PropertyName ,
101- Push ,
102101 removeTrailingDirectorySeparator ,
103102 returnTrue ,
104103 ScriptTarget ,
@@ -1699,12 +1698,12 @@ function createDiagnosticForInvalidCustomType(opt: CommandLineOptionOfCustomType
16991698}
17001699
17011700/** @internal */
1702- export function parseCustomTypeOption ( opt : CommandLineOptionOfCustomType , value : string , errors : Push < Diagnostic > ) {
1701+ export function parseCustomTypeOption ( opt : CommandLineOptionOfCustomType , value : string , errors : Diagnostic [ ] ) {
17031702 return convertJsonOptionOfCustomType ( opt , trimString ( value || "" ) , errors ) ;
17041703}
17051704
17061705/** @internal */
1707- export function parseListTypeOption ( opt : CommandLineOptionOfListType , value = "" , errors : Push < Diagnostic > ) : string | ( string | number ) [ ] | undefined {
1706+ export function parseListTypeOption ( opt : CommandLineOptionOfListType , value = "" , errors : Diagnostic [ ] ) : string | ( string | number ) [ ] | undefined {
17081707 value = trimString ( value ) ;
17091708 if ( startsWith ( value , "-" ) ) {
17101709 return undefined ;
@@ -2254,7 +2253,7 @@ export interface JsonConversionNotifier {
22542253 onSetUnknownOptionKeyValueInRoot ( key : string , keyNode : PropertyName , value : CompilerOptionsValue , valueNode : Expression ) : void ;
22552254}
22562255
2257- function convertConfigFileToObject ( sourceFile : JsonSourceFile , errors : Push < Diagnostic > , reportOptionsErrors : boolean , optionsIterator : JsonConversionNotifier | undefined ) : any {
2256+ function convertConfigFileToObject ( sourceFile : JsonSourceFile , errors : Diagnostic [ ] , reportOptionsErrors : boolean , optionsIterator : JsonConversionNotifier | undefined ) : any {
22582257 const rootExpression : Expression | undefined = sourceFile . statements [ 0 ] ?. expression ;
22592258 const knownRootOptions = reportOptionsErrors ? getTsconfigRootOptionsMap ( ) : undefined ;
22602259 if ( rootExpression && rootExpression . kind !== SyntaxKind . ObjectLiteralExpression ) {
@@ -2295,7 +2294,7 @@ export function convertToObject(sourceFile: JsonSourceFile, errors: Diagnostic[]
22952294export function convertToObjectWorker (
22962295 sourceFile : JsonSourceFile ,
22972296 rootExpression : Expression | undefined ,
2298- errors : Push < Diagnostic > ,
2297+ errors : Diagnostic [ ] ,
22992298 returnValue : boolean ,
23002299 knownRootOptions : CommandLineOption | undefined ,
23012300 jsonConversionNotifier : JsonConversionNotifier | undefined ) : any {
@@ -3248,7 +3247,7 @@ function parseOwnConfigOfJson(
32483247 host : ParseConfigHost ,
32493248 basePath : string ,
32503249 configFileName : string | undefined ,
3251- errors : Push < Diagnostic >
3250+ errors : Diagnostic [ ]
32523251) : ParsedTsconfig {
32533252 if ( hasProperty ( json , "excludes" ) ) {
32543253 errors . push ( createCompilerDiagnostic ( Diagnostics . Unknown_option_excludes_Did_you_mean_exclude ) ) ;
@@ -3290,7 +3289,7 @@ function parseOwnConfigOfJsonSourceFile(
32903289 host : ParseConfigHost ,
32913290 basePath : string ,
32923291 configFileName : string | undefined ,
3293- errors : Push < Diagnostic >
3292+ errors : Diagnostic [ ]
32943293) : ParsedTsconfig {
32953294 const options = getDefaultCompilerOptions ( configFileName ) ;
32963295 let typeAcquisition : TypeAcquisition | undefined ;
@@ -3376,7 +3375,7 @@ function getExtendsConfigPath(
33763375 extendedConfig : string ,
33773376 host : ParseConfigHost ,
33783377 basePath : string ,
3379- errors : Push < Diagnostic > ,
3378+ errors : Diagnostic [ ] ,
33803379 createDiagnostic : ( message : DiagnosticMessage , arg1 ?: string ) => Diagnostic ) {
33813380 extendedConfig = normalizeSlashes ( extendedConfig ) ;
33823381 if ( isRootedDiskPath ( extendedConfig ) || startsWith ( extendedConfig , "./" ) || startsWith ( extendedConfig , "../" ) ) {
@@ -3450,7 +3449,7 @@ function getExtendedConfig(
34503449 return extendedConfig ! ;
34513450}
34523451
3453- function convertCompileOnSaveOptionFromJson ( jsonOption : any , basePath : string , errors : Push < Diagnostic > ) : boolean {
3452+ function convertCompileOnSaveOptionFromJson ( jsonOption : any , basePath : string , errors : Diagnostic [ ] ) : boolean {
34543453 if ( ! hasProperty ( jsonOption , compileOnSaveCommandLineOption . name ) ) {
34553454 return false ;
34563455 }
@@ -3478,7 +3477,7 @@ function getDefaultCompilerOptions(configFileName?: string) {
34783477}
34793478
34803479function convertCompilerOptionsFromJsonWorker ( jsonOptions : any ,
3481- basePath : string , errors : Push < Diagnostic > , configFileName ?: string ) : CompilerOptions {
3480+ basePath : string , errors : Diagnostic [ ] , configFileName ?: string ) : CompilerOptions {
34823481
34833482 const options = getDefaultCompilerOptions ( configFileName ) ;
34843483 convertOptionsFromJson ( getCommandLineCompilerOptionsMap ( ) , jsonOptions , basePath , options , compilerOptionsDidYouMeanDiagnostics , errors ) ;
@@ -3493,23 +3492,23 @@ function getDefaultTypeAcquisition(configFileName?: string): TypeAcquisition {
34933492}
34943493
34953494function convertTypeAcquisitionFromJsonWorker ( jsonOptions : any ,
3496- basePath : string , errors : Push < Diagnostic > , configFileName ?: string ) : TypeAcquisition {
3495+ basePath : string , errors : Diagnostic [ ] , configFileName ?: string ) : TypeAcquisition {
34973496
34983497 const options = getDefaultTypeAcquisition ( configFileName ) ;
34993498 convertOptionsFromJson ( getCommandLineTypeAcquisitionMap ( ) , jsonOptions , basePath , options , typeAcquisitionDidYouMeanDiagnostics , errors ) ;
35003499 return options ;
35013500}
35023501
3503- function convertWatchOptionsFromJsonWorker ( jsonOptions : any , basePath : string , errors : Push < Diagnostic > ) : WatchOptions | undefined {
3502+ function convertWatchOptionsFromJsonWorker ( jsonOptions : any , basePath : string , errors : Diagnostic [ ] ) : WatchOptions | undefined {
35043503 return convertOptionsFromJson ( getCommandLineWatchOptionsMap ( ) , jsonOptions , basePath , /*defaultOptions*/ undefined , watchOptionsDidYouMeanDiagnostics , errors ) ;
35053504}
35063505
35073506function convertOptionsFromJson ( optionsNameMap : Map < string , CommandLineOption > , jsonOptions : any , basePath : string ,
3508- defaultOptions : undefined , diagnostics : DidYouMeanOptionsDiagnostics , errors : Push < Diagnostic > ) : WatchOptions | undefined ;
3507+ defaultOptions : undefined , diagnostics : DidYouMeanOptionsDiagnostics , errors : Diagnostic [ ] ) : WatchOptions | undefined ;
35093508function convertOptionsFromJson ( optionsNameMap : Map < string , CommandLineOption > , jsonOptions : any , basePath : string ,
3510- defaultOptions : CompilerOptions | TypeAcquisition , diagnostics : DidYouMeanOptionsDiagnostics , errors : Push < Diagnostic > ) : CompilerOptions | TypeAcquisition ;
3509+ defaultOptions : CompilerOptions | TypeAcquisition , diagnostics : DidYouMeanOptionsDiagnostics , errors : Diagnostic [ ] ) : CompilerOptions | TypeAcquisition ;
35113510function convertOptionsFromJson ( optionsNameMap : Map < string , CommandLineOption > , jsonOptions : any , basePath : string ,
3512- defaultOptions : CompilerOptions | TypeAcquisition | WatchOptions | undefined , diagnostics : DidYouMeanOptionsDiagnostics , errors : Push < Diagnostic > ) {
3511+ defaultOptions : CompilerOptions | TypeAcquisition | WatchOptions | undefined , diagnostics : DidYouMeanOptionsDiagnostics , errors : Diagnostic [ ] ) {
35133512
35143513 if ( ! jsonOptions ) {
35153514 return ;
@@ -3528,7 +3527,7 @@ function convertOptionsFromJson(optionsNameMap: Map<string, CommandLineOption>,
35283527}
35293528
35303529/** @internal */
3531- export function convertJsonOption ( opt : CommandLineOption , value : any , basePath : string , errors : Push < Diagnostic > ) : CompilerOptionsValue {
3530+ export function convertJsonOption ( opt : CommandLineOption , value : any , basePath : string , errors : Diagnostic [ ] ) : CompilerOptionsValue {
35323531 if ( isCompilerOptionsValue ( opt , value ) ) {
35333532 const optType = opt . type ;
35343533 if ( ( optType === "list" ) && isArray ( value ) ) {
@@ -3576,15 +3575,15 @@ function normalizeNonListOptionValue(option: CommandLineOption, basePath: string
35763575 return value ;
35773576}
35783577
3579- function validateJsonOptionValue < T extends CompilerOptionsValue > ( opt : CommandLineOption , value : T , errors : Push < Diagnostic > ) : T | undefined {
3578+ function validateJsonOptionValue < T extends CompilerOptionsValue > ( opt : CommandLineOption , value : T , errors : Diagnostic [ ] ) : T | undefined {
35803579 if ( isNullOrUndefined ( value ) ) return undefined ;
35813580 const d = opt . extraValidation ?.( value ) ;
35823581 if ( ! d ) return value ;
35833582 errors . push ( createCompilerDiagnostic ( ...d ) ) ;
35843583 return undefined ;
35853584}
35863585
3587- function convertJsonOptionOfCustomType ( opt : CommandLineOptionOfCustomType , value : string , errors : Push < Diagnostic > ) {
3586+ function convertJsonOptionOfCustomType ( opt : CommandLineOptionOfCustomType , value : string , errors : Diagnostic [ ] ) {
35883587 if ( isNullOrUndefined ( value ) ) return undefined ;
35893588 const key = value . toLowerCase ( ) ;
35903589 const val = opt . type . get ( key ) ;
@@ -3596,7 +3595,7 @@ function convertJsonOptionOfCustomType(opt: CommandLineOptionOfCustomType, value
35963595 }
35973596}
35983597
3599- function convertJsonOptionOfListType ( option : CommandLineOptionOfListType , values : readonly any [ ] , basePath : string , errors : Push < Diagnostic > ) : any [ ] {
3598+ function convertJsonOptionOfListType ( option : CommandLineOptionOfListType , values : readonly any [ ] , basePath : string , errors : Diagnostic [ ] ) : any [ ] {
36003599 return filter ( map ( values , v => convertJsonOption ( option . element , v , basePath , errors ) ) , v => option . listPreserveFalsyValues ? true : ! ! v ) ;
36013600}
36023601
@@ -3793,7 +3792,7 @@ function matchesExcludeWorker(
37933792 return ! hasExtension ( pathToCheck ) && excludeRegex . test ( ensureTrailingDirectorySeparator ( pathToCheck ) ) ;
37943793}
37953794
3796- function validateSpecs ( specs : readonly string [ ] , errors : Push < Diagnostic > , disallowTrailingRecursion : boolean , jsonSourceFile : TsConfigSourceFile | undefined , specKey : string ) : readonly string [ ] {
3795+ function validateSpecs ( specs : readonly string [ ] , errors : Diagnostic [ ] , disallowTrailingRecursion : boolean , jsonSourceFile : TsConfigSourceFile | undefined , specKey : string ) : readonly string [ ] {
37973796 return specs . filter ( spec => {
37983797 if ( ! isString ( spec ) ) return false ;
37993798 const diag = specToDiagnostic ( spec , disallowTrailingRecursion ) ;
0 commit comments