@@ -1664,7 +1664,7 @@ export function parseListTypeOption(opt: CommandLineOptionOfListType, value = ""
1664
1664
if ( startsWith ( value , "-" ) ) {
1665
1665
return undefined ;
1666
1666
}
1667
- if ( opt . type === "string | list " && ! stringContains ( value , "," ) ) {
1667
+ if ( opt . type === "listOrElement " && ! stringContains ( value , "," ) ) {
1668
1668
return validateJsonOptionValue ( opt , value , errors ) ;
1669
1669
}
1670
1670
if ( value === "" ) {
@@ -1678,7 +1678,7 @@ export function parseListTypeOption(opt: CommandLineOptionOfListType, value = ""
1678
1678
return mapDefined ( values , v => validateJsonOptionValue ( opt . element , v || "" , errors ) ) ;
1679
1679
case "boolean" :
1680
1680
case "object" :
1681
- case "string | list " :
1681
+ case "listOrElement " :
1682
1682
return Debug . fail ( `List of ${ opt . element . type } is not yet supported.` ) ;
1683
1683
default :
1684
1684
return mapDefined ( values , v => parseCustomTypeOption ( opt . element as CommandLineOptionOfCustomType , v , errors ) ) ;
@@ -1851,7 +1851,6 @@ function parseOptionValue(
1851
1851
options [ opt . name ] = validateJsonOptionValue ( opt , args [ i ] || "" , errors ) ;
1852
1852
i ++ ;
1853
1853
break ;
1854
- case "string | list" :
1855
1854
case "list" :
1856
1855
const result = parseListTypeOption ( opt , args [ i ] , errors ) ;
1857
1856
options [ opt . name ] = result || [ ] ;
@@ -2371,7 +2370,7 @@ export function convertToObjectWorker(
2371
2370
if ( ! isDoubleQuotedString ( valueExpression ) ) {
2372
2371
errors . push ( createDiagnosticForNodeInSourceFile ( sourceFile , valueExpression , Diagnostics . String_literal_with_double_quotes_expected ) ) ;
2373
2372
}
2374
- reportInvalidOptionValue ( option && isString ( option . type ) && option . type !== "string" && ( option . type !== "listOrElement" || ( isString ( option . element . type ) && option . element . type !== "string" ) ) && option . type !== "string | list" ) ;
2373
+ reportInvalidOptionValue ( option && isString ( option . type ) && option . type !== "string" && ( option . type !== "listOrElement" || ( isString ( option . element . type ) && option . element . type !== "string" ) ) ) ;
2375
2374
const text = ( valueExpression as StringLiteral ) . text ;
2376
2375
if ( option ) {
2377
2376
Debug . assert ( option . type !== "listOrElement" || option . element . type === "string" , "Only string or array of string is handled for now" ) ;
@@ -2403,7 +2402,7 @@ export function convertToObjectWorker(
2403
2402
return validateValue ( - Number ( ( ( valueExpression as PrefixUnaryExpression ) . operand as NumericLiteral ) . text ) ) ;
2404
2403
2405
2404
case SyntaxKind . ObjectLiteralExpression :
2406
- reportInvalidOptionValue ( option && option . type !== "object" && ( option . type !== "listOrElement" || option . element . type !== "object" ) && option . type !== "string | list" ) ;
2405
+ reportInvalidOptionValue ( option && option . type !== "object" && ( option . type !== "listOrElement" || option . element . type !== "object" ) ) ;
2407
2406
const objectLiteralExpression = valueExpression as ObjectLiteralExpression ;
2408
2407
2409
2408
// Currently having element option declaration in the tsconfig with type "object"
@@ -2481,9 +2480,6 @@ function isCompilerOptionsValue(option: CommandLineOption | undefined, value: an
2481
2480
if ( option . type === "listOrElement" ) {
2482
2481
return isArray ( value ) || isCompilerOptionsValue ( option . element , value ) ;
2483
2482
}
2484
- if ( option . type === "string | list" ) {
2485
- return typeof value === "string" || isArray ( value ) ;
2486
- }
2487
2483
const expectedType = isString ( option . type ) ? option . type : "string" ;
2488
2484
return typeof value === expectedType ;
2489
2485
}
@@ -2603,7 +2599,6 @@ function getCustomTypeMapOfCommandLineOption(optionDefinition: CommandLineOption
2603
2599
case "number" :
2604
2600
case "boolean" :
2605
2601
case "object" :
2606
- case "string | list" :
2607
2602
// this is of a type CommandLineOptionOfPrimitiveType
2608
2603
return undefined ;
2609
2604
case "list" :
@@ -3521,7 +3516,7 @@ function convertOptionsFromJson(optionsNameMap: Map<string, CommandLineOption>,
3521
3516
export function convertJsonOption ( opt : CommandLineOption , value : any , basePath : string , errors : Push < Diagnostic > ) : CompilerOptionsValue {
3522
3517
if ( isCompilerOptionsValue ( opt , value ) ) {
3523
3518
const optType = opt . type ;
3524
- if ( ( optType === "list" || opt . type === "string | list" ) && isArray ( value ) ) {
3519
+ if ( ( optType === "list" ) && isArray ( value ) ) {
3525
3520
return convertJsonOptionOfListType ( opt , value , basePath , errors ) ;
3526
3521
}
3527
3522
else if ( optType === "listOrElement" ) {
@@ -3975,7 +3970,6 @@ function getOptionValueWithEmptyStrings(value: any, option: CommandLineOption):
3975
3970
if ( ! isArray ( value ) ) return getOptionValueWithEmptyStrings ( value , option . element ) ;
3976
3971
// fall through to list
3977
3972
case "list" :
3978
- case "string | list" :
3979
3973
const elementType = option . element ;
3980
3974
return isArray ( value ) ? value . map ( v => getOptionValueWithEmptyStrings ( v , elementType ) ) : "" ;
3981
3975
default :
@@ -3995,7 +3989,6 @@ function getDefaultValueForOption(option: CommandLineOption): {} {
3995
3989
case "boolean" :
3996
3990
return true ;
3997
3991
case "string" :
3998
- case "string | list" :
3999
3992
const defaultValue = option . defaultValueDescription ;
4000
3993
return option . isFilePath ? `./${ defaultValue && typeof defaultValue === "string" ? defaultValue : "" } ` : "" ;
4001
3994
case "list" :
0 commit comments