@@ -98,7 +98,6 @@ import {
98
98
PrefixUnaryExpression ,
99
99
ProjectReference ,
100
100
PropertyName ,
101
- Push ,
102
101
removeTrailingDirectorySeparator ,
103
102
returnTrue ,
104
103
ScriptTarget ,
@@ -1699,12 +1698,12 @@ function createDiagnosticForInvalidCustomType(opt: CommandLineOptionOfCustomType
1699
1698
}
1700
1699
1701
1700
/** @internal */
1702
- export function parseCustomTypeOption ( opt : CommandLineOptionOfCustomType , value : string , errors : Push < Diagnostic > ) {
1701
+ export function parseCustomTypeOption ( opt : CommandLineOptionOfCustomType , value : string , errors : Diagnostic [ ] ) {
1703
1702
return convertJsonOptionOfCustomType ( opt , trimString ( value || "" ) , errors ) ;
1704
1703
}
1705
1704
1706
1705
/** @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 {
1708
1707
value = trimString ( value ) ;
1709
1708
if ( startsWith ( value , "-" ) ) {
1710
1709
return undefined ;
@@ -2254,7 +2253,7 @@ export interface JsonConversionNotifier {
2254
2253
onSetUnknownOptionKeyValueInRoot ( key : string , keyNode : PropertyName , value : CompilerOptionsValue , valueNode : Expression ) : void ;
2255
2254
}
2256
2255
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 {
2258
2257
const rootExpression : Expression | undefined = sourceFile . statements [ 0 ] ?. expression ;
2259
2258
const knownRootOptions = reportOptionsErrors ? getTsconfigRootOptionsMap ( ) : undefined ;
2260
2259
if ( rootExpression && rootExpression . kind !== SyntaxKind . ObjectLiteralExpression ) {
@@ -2295,7 +2294,7 @@ export function convertToObject(sourceFile: JsonSourceFile, errors: Diagnostic[]
2295
2294
export function convertToObjectWorker (
2296
2295
sourceFile : JsonSourceFile ,
2297
2296
rootExpression : Expression | undefined ,
2298
- errors : Push < Diagnostic > ,
2297
+ errors : Diagnostic [ ] ,
2299
2298
returnValue : boolean ,
2300
2299
knownRootOptions : CommandLineOption | undefined ,
2301
2300
jsonConversionNotifier : JsonConversionNotifier | undefined ) : any {
@@ -3248,7 +3247,7 @@ function parseOwnConfigOfJson(
3248
3247
host : ParseConfigHost ,
3249
3248
basePath : string ,
3250
3249
configFileName : string | undefined ,
3251
- errors : Push < Diagnostic >
3250
+ errors : Diagnostic [ ]
3252
3251
) : ParsedTsconfig {
3253
3252
if ( hasProperty ( json , "excludes" ) ) {
3254
3253
errors . push ( createCompilerDiagnostic ( Diagnostics . Unknown_option_excludes_Did_you_mean_exclude ) ) ;
@@ -3290,7 +3289,7 @@ function parseOwnConfigOfJsonSourceFile(
3290
3289
host : ParseConfigHost ,
3291
3290
basePath : string ,
3292
3291
configFileName : string | undefined ,
3293
- errors : Push < Diagnostic >
3292
+ errors : Diagnostic [ ]
3294
3293
) : ParsedTsconfig {
3295
3294
const options = getDefaultCompilerOptions ( configFileName ) ;
3296
3295
let typeAcquisition : TypeAcquisition | undefined ;
@@ -3376,7 +3375,7 @@ function getExtendsConfigPath(
3376
3375
extendedConfig : string ,
3377
3376
host : ParseConfigHost ,
3378
3377
basePath : string ,
3379
- errors : Push < Diagnostic > ,
3378
+ errors : Diagnostic [ ] ,
3380
3379
createDiagnostic : ( message : DiagnosticMessage , arg1 ?: string ) => Diagnostic ) {
3381
3380
extendedConfig = normalizeSlashes ( extendedConfig ) ;
3382
3381
if ( isRootedDiskPath ( extendedConfig ) || startsWith ( extendedConfig , "./" ) || startsWith ( extendedConfig , "../" ) ) {
@@ -3450,7 +3449,7 @@ function getExtendedConfig(
3450
3449
return extendedConfig ! ;
3451
3450
}
3452
3451
3453
- function convertCompileOnSaveOptionFromJson ( jsonOption : any , basePath : string , errors : Push < Diagnostic > ) : boolean {
3452
+ function convertCompileOnSaveOptionFromJson ( jsonOption : any , basePath : string , errors : Diagnostic [ ] ) : boolean {
3454
3453
if ( ! hasProperty ( jsonOption , compileOnSaveCommandLineOption . name ) ) {
3455
3454
return false ;
3456
3455
}
@@ -3478,7 +3477,7 @@ function getDefaultCompilerOptions(configFileName?: string) {
3478
3477
}
3479
3478
3480
3479
function convertCompilerOptionsFromJsonWorker ( jsonOptions : any ,
3481
- basePath : string , errors : Push < Diagnostic > , configFileName ?: string ) : CompilerOptions {
3480
+ basePath : string , errors : Diagnostic [ ] , configFileName ?: string ) : CompilerOptions {
3482
3481
3483
3482
const options = getDefaultCompilerOptions ( configFileName ) ;
3484
3483
convertOptionsFromJson ( getCommandLineCompilerOptionsMap ( ) , jsonOptions , basePath , options , compilerOptionsDidYouMeanDiagnostics , errors ) ;
@@ -3493,23 +3492,23 @@ function getDefaultTypeAcquisition(configFileName?: string): TypeAcquisition {
3493
3492
}
3494
3493
3495
3494
function convertTypeAcquisitionFromJsonWorker ( jsonOptions : any ,
3496
- basePath : string , errors : Push < Diagnostic > , configFileName ?: string ) : TypeAcquisition {
3495
+ basePath : string , errors : Diagnostic [ ] , configFileName ?: string ) : TypeAcquisition {
3497
3496
3498
3497
const options = getDefaultTypeAcquisition ( configFileName ) ;
3499
3498
convertOptionsFromJson ( getCommandLineTypeAcquisitionMap ( ) , jsonOptions , basePath , options , typeAcquisitionDidYouMeanDiagnostics , errors ) ;
3500
3499
return options ;
3501
3500
}
3502
3501
3503
- function convertWatchOptionsFromJsonWorker ( jsonOptions : any , basePath : string , errors : Push < Diagnostic > ) : WatchOptions | undefined {
3502
+ function convertWatchOptionsFromJsonWorker ( jsonOptions : any , basePath : string , errors : Diagnostic [ ] ) : WatchOptions | undefined {
3504
3503
return convertOptionsFromJson ( getCommandLineWatchOptionsMap ( ) , jsonOptions , basePath , /*defaultOptions*/ undefined , watchOptionsDidYouMeanDiagnostics , errors ) ;
3505
3504
}
3506
3505
3507
3506
function 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 ;
3509
3508
function 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 ;
3511
3510
function 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 [ ] ) {
3513
3512
3514
3513
if ( ! jsonOptions ) {
3515
3514
return ;
@@ -3528,7 +3527,7 @@ function convertOptionsFromJson(optionsNameMap: Map<string, CommandLineOption>,
3528
3527
}
3529
3528
3530
3529
/** @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 {
3532
3531
if ( isCompilerOptionsValue ( opt , value ) ) {
3533
3532
const optType = opt . type ;
3534
3533
if ( ( optType === "list" ) && isArray ( value ) ) {
@@ -3576,15 +3575,15 @@ function normalizeNonListOptionValue(option: CommandLineOption, basePath: string
3576
3575
return value ;
3577
3576
}
3578
3577
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 {
3580
3579
if ( isNullOrUndefined ( value ) ) return undefined ;
3581
3580
const d = opt . extraValidation ?.( value ) ;
3582
3581
if ( ! d ) return value ;
3583
3582
errors . push ( createCompilerDiagnostic ( ...d ) ) ;
3584
3583
return undefined ;
3585
3584
}
3586
3585
3587
- function convertJsonOptionOfCustomType ( opt : CommandLineOptionOfCustomType , value : string , errors : Push < Diagnostic > ) {
3586
+ function convertJsonOptionOfCustomType ( opt : CommandLineOptionOfCustomType , value : string , errors : Diagnostic [ ] ) {
3588
3587
if ( isNullOrUndefined ( value ) ) return undefined ;
3589
3588
const key = value . toLowerCase ( ) ;
3590
3589
const val = opt . type . get ( key ) ;
@@ -3596,7 +3595,7 @@ function convertJsonOptionOfCustomType(opt: CommandLineOptionOfCustomType, value
3596
3595
}
3597
3596
}
3598
3597
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 [ ] {
3600
3599
return filter ( map ( values , v => convertJsonOption ( option . element , v , basePath , errors ) ) , v => option . listPreserveFalsyValues ? true : ! ! v ) ;
3601
3600
}
3602
3601
@@ -3793,7 +3792,7 @@ function matchesExcludeWorker(
3793
3792
return ! hasExtension ( pathToCheck ) && excludeRegex . test ( ensureTrailingDirectorySeparator ( pathToCheck ) ) ;
3794
3793
}
3795
3794
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 [ ] {
3797
3796
return specs . filter ( spec => {
3798
3797
if ( ! isString ( spec ) ) return false ;
3799
3798
const diag = specToDiagnostic ( spec , disallowTrailingRecursion ) ;
0 commit comments