@@ -1664,7 +1664,7 @@ export function parseListTypeOption(opt: CommandLineOptionOfListType, value = ""
16641664 if ( startsWith ( value , "-" ) ) {
16651665 return undefined ;
16661666 }
1667- if ( opt . type === "string | list " && ! stringContains ( value , "," ) ) {
1667+ if ( opt . type === "listOrElement " && ! stringContains ( value , "," ) ) {
16681668 return validateJsonOptionValue ( opt , value , errors ) ;
16691669 }
16701670 if ( value === "" ) {
@@ -1678,7 +1678,7 @@ export function parseListTypeOption(opt: CommandLineOptionOfListType, value = ""
16781678 return mapDefined ( values , v => validateJsonOptionValue ( opt . element , v || "" , errors ) ) ;
16791679 case "boolean" :
16801680 case "object" :
1681- case "string | list " :
1681+ case "listOrElement " :
16821682 return Debug . fail ( `List of ${ opt . element . type } is not yet supported.` ) ;
16831683 default :
16841684 return mapDefined ( values , v => parseCustomTypeOption ( opt . element as CommandLineOptionOfCustomType , v , errors ) ) ;
@@ -1851,7 +1851,6 @@ function parseOptionValue(
18511851 options [ opt . name ] = validateJsonOptionValue ( opt , args [ i ] || "" , errors ) ;
18521852 i ++ ;
18531853 break ;
1854- case "string | list" :
18551854 case "list" :
18561855 const result = parseListTypeOption ( opt , args [ i ] , errors ) ;
18571856 options [ opt . name ] = result || [ ] ;
@@ -2371,7 +2370,7 @@ export function convertToObjectWorker(
23712370 if ( ! isDoubleQuotedString ( valueExpression ) ) {
23722371 errors . push ( createDiagnosticForNodeInSourceFile ( sourceFile , valueExpression , Diagnostics . String_literal_with_double_quotes_expected ) ) ;
23732372 }
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" ) ) ) ;
23752374 const text = ( valueExpression as StringLiteral ) . text ;
23762375 if ( option ) {
23772376 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(
24032402 return validateValue ( - Number ( ( ( valueExpression as PrefixUnaryExpression ) . operand as NumericLiteral ) . text ) ) ;
24042403
24052404 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" ) ) ;
24072406 const objectLiteralExpression = valueExpression as ObjectLiteralExpression ;
24082407
24092408 // Currently having element option declaration in the tsconfig with type "object"
@@ -2481,9 +2480,6 @@ function isCompilerOptionsValue(option: CommandLineOption | undefined, value: an
24812480 if ( option . type === "listOrElement" ) {
24822481 return isArray ( value ) || isCompilerOptionsValue ( option . element , value ) ;
24832482 }
2484- if ( option . type === "string | list" ) {
2485- return typeof value === "string" || isArray ( value ) ;
2486- }
24872483 const expectedType = isString ( option . type ) ? option . type : "string" ;
24882484 return typeof value === expectedType ;
24892485 }
@@ -2603,7 +2599,6 @@ function getCustomTypeMapOfCommandLineOption(optionDefinition: CommandLineOption
26032599 case "number" :
26042600 case "boolean" :
26052601 case "object" :
2606- case "string | list" :
26072602 // this is of a type CommandLineOptionOfPrimitiveType
26082603 return undefined ;
26092604 case "list" :
@@ -3521,7 +3516,7 @@ function convertOptionsFromJson(optionsNameMap: Map<string, CommandLineOption>,
35213516export function convertJsonOption ( opt : CommandLineOption , value : any , basePath : string , errors : Push < Diagnostic > ) : CompilerOptionsValue {
35223517 if ( isCompilerOptionsValue ( opt , value ) ) {
35233518 const optType = opt . type ;
3524- if ( ( optType === "list" || opt . type === "string | list" ) && isArray ( value ) ) {
3519+ if ( ( optType === "list" ) && isArray ( value ) ) {
35253520 return convertJsonOptionOfListType ( opt , value , basePath , errors ) ;
35263521 }
35273522 else if ( optType === "listOrElement" ) {
@@ -3975,7 +3970,6 @@ function getOptionValueWithEmptyStrings(value: any, option: CommandLineOption):
39753970 if ( ! isArray ( value ) ) return getOptionValueWithEmptyStrings ( value , option . element ) ;
39763971 // fall through to list
39773972 case "list" :
3978- case "string | list" :
39793973 const elementType = option . element ;
39803974 return isArray ( value ) ? value . map ( v => getOptionValueWithEmptyStrings ( v , elementType ) ) : "" ;
39813975 default :
@@ -3995,7 +3989,6 @@ function getDefaultValueForOption(option: CommandLineOption): {} {
39953989 case "boolean" :
39963990 return true ;
39973991 case "string" :
3998- case "string | list" :
39993992 const defaultValue = option . defaultValueDescription ;
40003993 return option . isFilePath ? `./${ defaultValue && typeof defaultValue === "string" ? defaultValue : "" } ` : "" ;
40013994 case "list" :
0 commit comments