diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index feee1493eb16a..4e3b23a5ccbab 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -217,6 +217,7 @@ const libEntries: [string, string][] = [ ["es2022.regexp", "lib.es2022.regexp.d.ts"], ["es2023.array", "lib.es2023.array.d.ts"], ["es2023.collection", "lib.es2023.collection.d.ts"], + ["es2023.intl", "lib.es2023.intl.d.ts"], ["esnext.array", "lib.es2023.array.d.ts"], ["esnext.collection", "lib.esnext.collection.d.ts"], ["esnext.symbol", "lib.es2019.symbol.d.ts"], diff --git a/src/lib/es2018.intl.d.ts b/src/lib/es2018.intl.d.ts index ee58de50e5c37..9bfa24d277b0b 100644 --- a/src/lib/es2018.intl.d.ts +++ b/src/lib/es2018.intl.d.ts @@ -37,10 +37,22 @@ declare namespace Intl { const PluralRules: PluralRulesConstructor; - // We can only have one definition for 'type' in TypeScript, and so you can learn where the keys come from here: - type ES2018NumberFormatPartType = "literal" | "nan" | "infinity" | "percent" | "integer" | "group" | "decimal" | "fraction" | "plusSign" | "minusSign" | "percentSign" | "currency" | "code" | "symbol" | "name"; - type ES2020NumberFormatPartType = "compact" | "exponentInteger" | "exponentMinusSign" | "exponentSeparator" | "unit" | "unknown"; - type NumberFormatPartTypes = ES2018NumberFormatPartType | ES2020NumberFormatPartType; + interface NumberFormatPartTypeRegistry { + literal: never; + nan: never; + infinity: never; + percent: never; + integer: never; + group: never; + decimal: never; + fraction: never; + plusSign: never; + minusSign: never; + percentSign: never; + currency: never; + } + + type NumberFormatPartTypes = keyof NumberFormatPartTypeRegistry; interface NumberFormatPart { type: NumberFormatPartTypes; diff --git a/src/lib/es2019.intl.d.ts b/src/lib/es2019.intl.d.ts index c7b62bcf8bded..bbd0afba9dc57 100644 --- a/src/lib/es2019.intl.d.ts +++ b/src/lib/es2019.intl.d.ts @@ -1,5 +1,5 @@ declare namespace Intl { interface DateTimeFormatPartTypesRegistry { - unknown: any; + unknown: never; } } diff --git a/src/lib/es2020.bigint.d.ts b/src/lib/es2020.bigint.d.ts index 597b3822792eb..c2d3267e365e4 100644 --- a/src/lib/es2020.bigint.d.ts +++ b/src/lib/es2020.bigint.d.ts @@ -705,6 +705,5 @@ interface DataView { declare namespace Intl { interface NumberFormat { format(value: number | bigint): string; - resolvedOptions(): ResolvedNumberFormatOptions; } } diff --git a/src/lib/es2020.intl.d.ts b/src/lib/es2020.intl.d.ts index d63508249ddcb..58cb28614af82 100644 --- a/src/lib/es2020.intl.d.ts +++ b/src/lib/es2020.intl.d.ts @@ -223,24 +223,49 @@ declare namespace Intl { ): UnicodeBCP47LocaleIdentifier[]; }; + interface NumberFormatOptionsStyleRegistry { + unit: never; + } + + interface NumberFormatOptionsCurrencyDisplayRegistry { + narrowSymbol: never; + } + + interface NumberFormatOptionsSignDisplayRegistry { + auto: never; + never: never; + always: never; + exceptZero: never; + } + + type NumberFormatOptionsSignDisplay = keyof NumberFormatOptionsSignDisplayRegistry; + interface NumberFormatOptions { + numberingSystem?: string | undefined; compactDisplay?: "short" | "long" | undefined; notation?: "standard" | "scientific" | "engineering" | "compact" | undefined; - signDisplay?: "auto" | "never" | "always" | "exceptZero" | undefined; + signDisplay?: NumberFormatOptionsSignDisplay | undefined; unit?: string | undefined; unitDisplay?: "short" | "long" | "narrow" | undefined; - currencyDisplay?: string | undefined; - currencySign?: string | undefined; + currencySign?: "standard" | "accounting" | undefined; } interface ResolvedNumberFormatOptions { compactDisplay?: "short" | "long"; - notation?: "standard" | "scientific" | "engineering" | "compact"; - signDisplay?: "auto" | "never" | "always" | "exceptZero"; + notation: "standard" | "scientific" | "engineering" | "compact"; + signDisplay: NumberFormatOptionsSignDisplay; unit?: string; unitDisplay?: "short" | "long" | "narrow"; - currencyDisplay?: string; - currencySign?: string; + currencySign?: "standard" | "accounting"; + } + + interface NumberFormatPartTypeRegistry { + compact: never; + exponentInteger: never; + exponentMinusSign: never; + exponentSeparator: never; + unit: never; + unknown: never; } interface DateTimeFormatOptions { diff --git a/src/lib/es2023.d.ts b/src/lib/es2023.d.ts index 5c45f807e08a8..2b3132f1c19e8 100644 --- a/src/lib/es2023.d.ts +++ b/src/lib/es2023.d.ts @@ -1,3 +1,4 @@ /// /// /// +/// diff --git a/src/lib/es2023.intl.d.ts b/src/lib/es2023.intl.d.ts new file mode 100644 index 0000000000000..b3de1fdd1020c --- /dev/null +++ b/src/lib/es2023.intl.d.ts @@ -0,0 +1,34 @@ +declare namespace Intl { + interface NumberFormatOptionsUseGroupingRegistry { + min2: never; + auto: never; + always: never; + } + + interface NumberFormatOptionsSignDisplayRegistry { + negative: never; + } + + interface NumberFormatOptions { + roundingPriority?: "auto" | "morePrecision" | "lessPrecision" | undefined; + roundingIncrement?: 1 | 2 | 5 | 10 | 20 | 25 | 50 | 100 | 200 | 250 | 500 | 1000 | 2000 | 2500 | 5000 | undefined; + roundingMode?: "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven" | undefined; + trailingZeroDisplay?: "auto" | "stripIfInteger" | undefined; + } + + interface ResolvedNumberFormatOptions { + roundingPriority: "auto" | "morePrecision" | "lessPrecision"; + roundingMode: "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven"; + roundingIncrement: 1 | 2 | 5 | 10 | 20 | 25 | 50 | 100 | 200 | 250 | 500 | 1000 | 2000 | 2500 | 5000; + trailingZeroDisplay: "auto" | "stripIfInteger"; + } + + interface NumberRangeFormatPart extends NumberFormatPart { + source: "startRange" | "endRange" | "shared"; + } + + interface NumberFormat { + formatRange(start: number | bigint, end: number | bigint): string; + formatRangeToParts(start: number | bigint, end: number | bigint): NumberRangeFormatPart[]; + } +} diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 6a7d6c6da091e..e404df509a1c0 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -4415,12 +4415,33 @@ declare namespace Intl { var Collator: CollatorConstructor; + interface NumberFormatOptionsStyleRegistry { + decimal: never; + percent: never; + currency: never; + } + + type NumberFormatOptionsStyle = keyof NumberFormatOptionsStyleRegistry; + + interface NumberFormatOptionsCurrencyDisplayRegistry { + code: never; + symbol: never; + name: never; + } + + type NumberFormatOptionsCurrencyDisplay = keyof NumberFormatOptionsCurrencyDisplayRegistry; + + interface NumberFormatOptionsUseGroupingRegistry {} + + type NumberFormatOptionsUseGrouping = {} extends NumberFormatOptionsUseGroupingRegistry ? boolean : keyof NumberFormatOptionsUseGroupingRegistry | "true" | "false" | boolean; + type ResolvedNumberFormatOptionsUseGrouping = {} extends NumberFormatOptionsUseGroupingRegistry ? boolean : keyof NumberFormatOptionsUseGroupingRegistry | false; + interface NumberFormatOptions { - localeMatcher?: string | undefined; - style?: string | undefined; + localeMatcher?: "lookup" | "best fit" | undefined; + style?: NumberFormatOptionsStyle | undefined; currency?: string | undefined; - currencySign?: string | undefined; - useGrouping?: boolean | undefined; + currencyDisplay?: NumberFormatOptionsCurrencyDisplay | undefined; + useGrouping?: NumberFormatOptionsUseGrouping | undefined; minimumIntegerDigits?: number | undefined; minimumFractionDigits?: number | undefined; maximumFractionDigits?: number | undefined; @@ -4431,14 +4452,15 @@ declare namespace Intl { interface ResolvedNumberFormatOptions { locale: string; numberingSystem: string; - style: string; + style: NumberFormatOptionsStyle; currency?: string; + currencyDisplay?: NumberFormatOptionsCurrencyDisplay; minimumIntegerDigits: number; - minimumFractionDigits: number; - maximumFractionDigits: number; + minimumFractionDigits?: number; + maximumFractionDigits?: number; minimumSignificantDigits?: number; maximumSignificantDigits?: number; - useGrouping: boolean; + useGrouping: ResolvedNumberFormatOptionsUseGrouping; } interface NumberFormat { diff --git a/src/lib/esnext.intl.d.ts b/src/lib/esnext.intl.d.ts index b6d59cfa0d9fc..9aacedd724469 100644 --- a/src/lib/esnext.intl.d.ts +++ b/src/lib/esnext.intl.d.ts @@ -1,10 +1,3 @@ declare namespace Intl { - interface NumberRangeFormatPart extends NumberFormatPart { - source: "startRange" | "endRange" | "shared"; - } - - interface NumberFormat { - formatRange(start: number | bigint, end: number | bigint): string; - formatRangeToParts(start: number | bigint, end: number | bigint): NumberRangeFormatPart[]; - } + // Empty } diff --git a/src/lib/libs.json b/src/lib/libs.json index 3258386a2c53e..a77c42e8ba82d 100644 --- a/src/lib/libs.json +++ b/src/lib/libs.json @@ -70,6 +70,7 @@ "es2022.regexp", "es2023.array", "es2023.collection", + "es2023.intl", "esnext.decorators", "esnext.intl", "esnext.disposable", diff --git a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.errors.txt b/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.errors.txt deleted file mode 100644 index ad96fbe2ee110..0000000000000 --- a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.errors.txt +++ /dev/null @@ -1,20 +0,0 @@ -DateTimeFormatAndNumberFormatES2021.ts(1,29): error TS2339: Property 'formatRange' does not exist on type 'NumberFormat'. -DateTimeFormatAndNumberFormatES2021.ts(4,25): error TS2339: Property 'formatRange' does not exist on type 'NumberFormat'. -DateTimeFormatAndNumberFormatES2021.ts(5,25): error TS2551: Property 'formatRangeToParts' does not exist on type 'NumberFormat'. Did you mean 'formatToParts'? - - -==== DateTimeFormatAndNumberFormatES2021.ts (3 errors) ==== - Intl.NumberFormat.prototype.formatRange - ~~~~~~~~~~~ -!!! error TS2339: Property 'formatRange' does not exist on type 'NumberFormat'. - Intl.DateTimeFormat.prototype.formatRange - - new Intl.NumberFormat().formatRange - ~~~~~~~~~~~ -!!! error TS2339: Property 'formatRange' does not exist on type 'NumberFormat'. - new Intl.NumberFormat().formatRangeToParts - ~~~~~~~~~~~~~~~~~~ -!!! error TS2551: Property 'formatRangeToParts' does not exist on type 'NumberFormat'. Did you mean 'formatToParts'? -!!! related TS2728 lib.es2018.intl.d.ts:--:--: 'formatToParts' is declared here. - new Intl.DateTimeFormat().formatRange - new Intl.DateTimeFormat().formatRangeToParts \ No newline at end of file diff --git a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.js b/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.js deleted file mode 100644 index 8bd25380b8b8d..0000000000000 --- a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.js +++ /dev/null @@ -1,18 +0,0 @@ -//// [tests/cases/compiler/DateTimeFormatAndNumberFormatES2021.ts] //// - -//// [DateTimeFormatAndNumberFormatES2021.ts] -Intl.NumberFormat.prototype.formatRange -Intl.DateTimeFormat.prototype.formatRange - -new Intl.NumberFormat().formatRange -new Intl.NumberFormat().formatRangeToParts -new Intl.DateTimeFormat().formatRange -new Intl.DateTimeFormat().formatRangeToParts - -//// [DateTimeFormatAndNumberFormatES2021.js] -Intl.NumberFormat.prototype.formatRange; -Intl.DateTimeFormat.prototype.formatRange; -new Intl.NumberFormat().formatRange; -new Intl.NumberFormat().formatRangeToParts; -new Intl.DateTimeFormat().formatRange; -new Intl.DateTimeFormat().formatRangeToParts; diff --git a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.symbols b/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.symbols deleted file mode 100644 index 82aede47ba9b7..0000000000000 --- a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.symbols +++ /dev/null @@ -1,43 +0,0 @@ -//// [tests/cases/compiler/DateTimeFormatAndNumberFormatES2021.ts] //// - -=== DateTimeFormatAndNumberFormatES2021.ts === -Intl.NumberFormat.prototype.formatRange ->Intl.NumberFormat.prototype : Symbol(Intl.NumberFormatConstructor.prototype, Decl(lib.es5.d.ts, --, --)) ->Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) ->NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) ->prototype : Symbol(Intl.NumberFormatConstructor.prototype, Decl(lib.es5.d.ts, --, --)) - -Intl.DateTimeFormat.prototype.formatRange ->Intl.DateTimeFormat.prototype.formatRange : Symbol(Intl.DateTimeFormat.formatRange, Decl(lib.es2021.intl.d.ts, --, --)) ->Intl.DateTimeFormat.prototype : Symbol(Intl.DateTimeFormatConstructor.prototype, Decl(lib.es5.d.ts, --, --)) ->Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) ->DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) ->prototype : Symbol(Intl.DateTimeFormatConstructor.prototype, Decl(lib.es5.d.ts, --, --)) ->formatRange : Symbol(Intl.DateTimeFormat.formatRange, Decl(lib.es2021.intl.d.ts, --, --)) - -new Intl.NumberFormat().formatRange ->Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) ->NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) - -new Intl.NumberFormat().formatRangeToParts ->Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) ->NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) - -new Intl.DateTimeFormat().formatRange ->new Intl.DateTimeFormat().formatRange : Symbol(Intl.DateTimeFormat.formatRange, Decl(lib.es2021.intl.d.ts, --, --)) ->Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) ->DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) ->formatRange : Symbol(Intl.DateTimeFormat.formatRange, Decl(lib.es2021.intl.d.ts, --, --)) - -new Intl.DateTimeFormat().formatRangeToParts ->new Intl.DateTimeFormat().formatRangeToParts : Symbol(Intl.DateTimeFormat.formatRangeToParts, Decl(lib.es2021.intl.d.ts, --, --)) ->Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) ->DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) ->formatRangeToParts : Symbol(Intl.DateTimeFormat.formatRangeToParts, Decl(lib.es2021.intl.d.ts, --, --)) - diff --git a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types b/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types deleted file mode 100644 index e499924e25857..0000000000000 --- a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types +++ /dev/null @@ -1,53 +0,0 @@ -//// [tests/cases/compiler/DateTimeFormatAndNumberFormatES2021.ts] //// - -=== DateTimeFormatAndNumberFormatES2021.ts === -Intl.NumberFormat.prototype.formatRange ->Intl.NumberFormat.prototype.formatRange : any ->Intl.NumberFormat.prototype : Intl.NumberFormat ->Intl.NumberFormat : Intl.NumberFormatConstructor ->Intl : typeof Intl ->NumberFormat : Intl.NumberFormatConstructor ->prototype : Intl.NumberFormat ->formatRange : any - -Intl.DateTimeFormat.prototype.formatRange ->Intl.DateTimeFormat.prototype.formatRange : (startDate: number | bigint | Date, endDate: number | bigint | Date) => string ->Intl.DateTimeFormat.prototype : Intl.DateTimeFormat ->Intl.DateTimeFormat : Intl.DateTimeFormatConstructor ->Intl : typeof Intl ->DateTimeFormat : Intl.DateTimeFormatConstructor ->prototype : Intl.DateTimeFormat ->formatRange : (startDate: number | bigint | Date, endDate: number | bigint | Date) => string - -new Intl.NumberFormat().formatRange ->new Intl.NumberFormat().formatRange : any ->new Intl.NumberFormat() : Intl.NumberFormat ->Intl.NumberFormat : Intl.NumberFormatConstructor ->Intl : typeof Intl ->NumberFormat : Intl.NumberFormatConstructor ->formatRange : any - -new Intl.NumberFormat().formatRangeToParts ->new Intl.NumberFormat().formatRangeToParts : any ->new Intl.NumberFormat() : Intl.NumberFormat ->Intl.NumberFormat : Intl.NumberFormatConstructor ->Intl : typeof Intl ->NumberFormat : Intl.NumberFormatConstructor ->formatRangeToParts : any - -new Intl.DateTimeFormat().formatRange ->new Intl.DateTimeFormat().formatRange : (startDate: number | bigint | Date, endDate: number | bigint | Date) => string ->new Intl.DateTimeFormat() : Intl.DateTimeFormat ->Intl.DateTimeFormat : Intl.DateTimeFormatConstructor ->Intl : typeof Intl ->DateTimeFormat : Intl.DateTimeFormatConstructor ->formatRange : (startDate: number | bigint | Date, endDate: number | bigint | Date) => string - -new Intl.DateTimeFormat().formatRangeToParts ->new Intl.DateTimeFormat().formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeRangeFormatPart[] ->new Intl.DateTimeFormat() : Intl.DateTimeFormat ->Intl.DateTimeFormat : Intl.DateTimeFormatConstructor ->Intl : typeof Intl ->DateTimeFormat : Intl.DateTimeFormatConstructor ->formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeRangeFormatPart[] - diff --git a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with extra comma.js b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with extra comma.js index cd421cd200b7c..50d212df64c58 100644 --- a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with extra comma.js +++ b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with extra comma.js @@ -10,4 +10,4 @@ WatchOptions:: FileNames:: es7,0.ts Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with trailing white-space.js b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with trailing white-space.js index fabeb52959d52..c9686eb91973e 100644 --- a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with trailing white-space.js +++ b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with trailing white-space.js @@ -10,4 +10,4 @@ WatchOptions:: FileNames:: es7,0.ts Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse invalid option of library flags.js b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse invalid option of library flags.js index e0e3de1debba3..7b738b01212ab 100644 --- a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse invalid option of library flags.js +++ b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse invalid option of library flags.js @@ -10,4 +10,4 @@ WatchOptions:: FileNames:: 0.ts Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js index 347aaaaff50d1..7b2cd2a898945 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js @@ -30,5 +30,5 @@ CompilerOptions:: "configFilePath": "tsconfig.json" } Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js index 2318431048871..aaf951a8cd294 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js @@ -30,7 +30,7 @@ CompilerOptions:: "configFilePath": "tsconfig.json" } Errors:: -tsconfig.json:8:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'. +tsconfig.json:8:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'. 8 ""    ~~ diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js index 29e437f45f1f4..e2e2c5840d7c6 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js @@ -33,5 +33,5 @@ CompilerOptions:: "configFilePath": "tsconfig.json" } Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js index 2576767fca19d..0095beed1414f 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js @@ -33,7 +33,7 @@ CompilerOptions:: "configFilePath": "tsconfig.json" } Errors:: -tsconfig.json:9:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'. +tsconfig.json:9:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'. 9 ""    ~~ diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js index d416471d82cc8..f612dfca2e012 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js @@ -35,5 +35,5 @@ CompilerOptions:: "configFilePath": "tsconfig.json" } Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js index 751b7b61ae565..d7c27513aed87 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js @@ -35,7 +35,7 @@ CompilerOptions:: "configFilePath": "tsconfig.json" } Errors:: -tsconfig.json:10:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'. +tsconfig.json:10:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'. 10 "incorrectLib"    ~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js index 64fc869bb68ac..9812b86320433 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js @@ -30,5 +30,5 @@ CompilerOptions:: "configFilePath": "tsconfig.json" } Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js index 833000aa896cf..a98b298223664 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js @@ -30,7 +30,7 @@ CompilerOptions:: "configFilePath": "tsconfig.json" } Errors:: -tsconfig.json:8:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'. +tsconfig.json:8:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'. 8 " "    ~~~~~ diff --git a/tests/baselines/reference/es2018IntlAPIs.js b/tests/baselines/reference/es2018IntlAPIs.js index 53a320ce48cf3..707c4c65bfb4f 100644 --- a/tests/baselines/reference/es2018IntlAPIs.js +++ b/tests/baselines/reference/es2018IntlAPIs.js @@ -5,7 +5,11 @@ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/PluralRules/supportedLocalesOf const locales = ['ban', 'id-u-co-pinyin', 'de-ID']; const options = { localeMatcher: 'lookup' } as const; -console.log(Intl.PluralRules.supportedLocalesOf(locales, options).join(', ')); +console.log(Intl.PluralRules.supportedLocalesOf(locales, options).join(', ')); + +const [ part ] = new Intl.NumberFormat().formatToParts(); +console.log(part.type, part.value); + //// [es2018IntlAPIs.js] // Sample from @@ -13,3 +17,5 @@ console.log(Intl.PluralRules.supportedLocalesOf(locales, options).join(', ')); const locales = ['ban', 'id-u-co-pinyin', 'de-ID']; const options = { localeMatcher: 'lookup' }; console.log(Intl.PluralRules.supportedLocalesOf(locales, options).join(', ')); +const [part] = new Intl.NumberFormat().formatToParts(); +console.log(part.type, part.value); diff --git a/tests/baselines/reference/es2018IntlAPIs.symbols b/tests/baselines/reference/es2018IntlAPIs.symbols index 56fe5b94adbb3..e9f24e896c9b4 100644 --- a/tests/baselines/reference/es2018IntlAPIs.symbols +++ b/tests/baselines/reference/es2018IntlAPIs.symbols @@ -25,3 +25,22 @@ console.log(Intl.PluralRules.supportedLocalesOf(locales, options).join(', ')); >options : Symbol(options, Decl(es2018IntlAPIs.ts, 3, 5)) >join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) +const [ part ] = new Intl.NumberFormat().formatToParts(); +>part : Symbol(part, Decl(es2018IntlAPIs.ts, 6, 7)) +>new Intl.NumberFormat().formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --)) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --)) +>formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) + +console.log(part.type, part.value); +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>part.type : Symbol(Intl.NumberFormatPart.type, Decl(lib.es2018.intl.d.ts, --, --)) +>part : Symbol(part, Decl(es2018IntlAPIs.ts, 6, 7)) +>type : Symbol(Intl.NumberFormatPart.type, Decl(lib.es2018.intl.d.ts, --, --)) +>part.value : Symbol(Intl.NumberFormatPart.value, Decl(lib.es2018.intl.d.ts, --, --)) +>part : Symbol(part, Decl(es2018IntlAPIs.ts, 6, 7)) +>value : Symbol(Intl.NumberFormatPart.value, Decl(lib.es2018.intl.d.ts, --, --)) + diff --git a/tests/baselines/reference/es2018IntlAPIs.types b/tests/baselines/reference/es2018IntlAPIs.types index a66c377532125..3c1142abbeaa6 100644 --- a/tests/baselines/reference/es2018IntlAPIs.types +++ b/tests/baselines/reference/es2018IntlAPIs.types @@ -35,3 +35,25 @@ console.log(Intl.PluralRules.supportedLocalesOf(locales, options).join(', ')); >join : (separator?: string) => string >', ' : ", " +const [ part ] = new Intl.NumberFormat().formatToParts(); +>part : Intl.NumberFormatPart +>new Intl.NumberFormat().formatToParts() : Intl.NumberFormatPart[] +>new Intl.NumberFormat().formatToParts : (number?: number | bigint) => Intl.NumberFormatPart[] +>new Intl.NumberFormat() : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>formatToParts : (number?: number | bigint) => Intl.NumberFormatPart[] + +console.log(part.type, part.value); +>console.log(part.type, part.value) : void +>console.log : (...data: any[]) => void +>console : Console +>log : (...data: any[]) => void +>part.type : keyof Intl.NumberFormatPartTypeRegistry +>part : Intl.NumberFormatPart +>type : keyof Intl.NumberFormatPartTypeRegistry +>part.value : string +>part : Intl.NumberFormatPart +>value : string + diff --git a/tests/baselines/reference/esnext.bigintIncludesNumberFormatPartTypes.js b/tests/baselines/reference/esnext.bigintIncludesNumberFormatPartTypes.js deleted file mode 100644 index 9907fdec3818b..0000000000000 --- a/tests/baselines/reference/esnext.bigintIncludesNumberFormatPartTypes.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [tests/cases/compiler/esnext.bigintIncludesNumberFormatPartTypes.ts] //// - -//// [esnext.bigintIncludesNumberFormatPartTypes.ts] -/// -var t: Intl.NumberFormatPartTypes - - -//// [esnext.bigintIncludesNumberFormatPartTypes.js] -/// -var t; diff --git a/tests/baselines/reference/esnext.bigintIncludesNumberFormatPartTypes.symbols b/tests/baselines/reference/esnext.bigintIncludesNumberFormatPartTypes.symbols deleted file mode 100644 index 4fe98c172b4f2..0000000000000 --- a/tests/baselines/reference/esnext.bigintIncludesNumberFormatPartTypes.symbols +++ /dev/null @@ -1,9 +0,0 @@ -//// [tests/cases/compiler/esnext.bigintIncludesNumberFormatPartTypes.ts] //// - -=== esnext.bigintIncludesNumberFormatPartTypes.ts === -/// -var t: Intl.NumberFormatPartTypes ->t : Symbol(t, Decl(esnext.bigintIncludesNumberFormatPartTypes.ts, 1, 3)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) ->NumberFormatPartTypes : Symbol(Intl.NumberFormatPartTypes, Decl(lib.es2018.intl.d.ts, --, --)) - diff --git a/tests/baselines/reference/esnext.bigintIncludesNumberFormatPartTypes.types b/tests/baselines/reference/esnext.bigintIncludesNumberFormatPartTypes.types deleted file mode 100644 index f909111af3e40..0000000000000 --- a/tests/baselines/reference/esnext.bigintIncludesNumberFormatPartTypes.types +++ /dev/null @@ -1,8 +0,0 @@ -//// [tests/cases/compiler/esnext.bigintIncludesNumberFormatPartTypes.ts] //// - -=== esnext.bigintIncludesNumberFormatPartTypes.ts === -/// -var t: Intl.NumberFormatPartTypes ->t : Intl.NumberFormatPartTypes ->Intl : any - diff --git a/tests/baselines/reference/formatToPartsBigInt.js b/tests/baselines/reference/formatToPartsBigInt.js deleted file mode 100644 index 132193616508d..0000000000000 --- a/tests/baselines/reference/formatToPartsBigInt.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [tests/cases/compiler/formatToPartsBigInt.ts] //// - -//// [formatToPartsBigInt.ts] -// Intl.NumberFormat.formatToParts should support bigInt - -// Test Intl methods with new parameter type -new Intl.NumberFormat("fr").formatToParts(3000n); -new Intl.NumberFormat("fr").formatToParts(BigInt(123)); - - -//// [formatToPartsBigInt.js] -// Intl.NumberFormat.formatToParts should support bigInt -// Test Intl methods with new parameter type -new Intl.NumberFormat("fr").formatToParts(3000n); -new Intl.NumberFormat("fr").formatToParts(BigInt(123)); diff --git a/tests/baselines/reference/formatToPartsBigInt.symbols b/tests/baselines/reference/formatToPartsBigInt.symbols deleted file mode 100644 index afca8e88e0f5b..0000000000000 --- a/tests/baselines/reference/formatToPartsBigInt.symbols +++ /dev/null @@ -1,21 +0,0 @@ -//// [tests/cases/compiler/formatToPartsBigInt.ts] //// - -=== formatToPartsBigInt.ts === -// Intl.NumberFormat.formatToParts should support bigInt - -// Test Intl methods with new parameter type -new Intl.NumberFormat("fr").formatToParts(3000n); ->new Intl.NumberFormat("fr").formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) ->Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) ->NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) ->formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) - -new Intl.NumberFormat("fr").formatToParts(BigInt(123)); ->new Intl.NumberFormat("fr").formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) ->Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) ->NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) ->formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) ->BigInt : Symbol(BigInt, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) - diff --git a/tests/baselines/reference/formatToPartsBigInt.types b/tests/baselines/reference/formatToPartsBigInt.types deleted file mode 100644 index 3b42619f102e0..0000000000000 --- a/tests/baselines/reference/formatToPartsBigInt.types +++ /dev/null @@ -1,30 +0,0 @@ -//// [tests/cases/compiler/formatToPartsBigInt.ts] //// - -=== formatToPartsBigInt.ts === -// Intl.NumberFormat.formatToParts should support bigInt - -// Test Intl methods with new parameter type -new Intl.NumberFormat("fr").formatToParts(3000n); ->new Intl.NumberFormat("fr").formatToParts(3000n) : Intl.NumberFormatPart[] ->new Intl.NumberFormat("fr").formatToParts : (number?: number | bigint) => Intl.NumberFormatPart[] ->new Intl.NumberFormat("fr") : Intl.NumberFormat ->Intl.NumberFormat : Intl.NumberFormatConstructor ->Intl : typeof Intl ->NumberFormat : Intl.NumberFormatConstructor ->"fr" : "fr" ->formatToParts : (number?: number | bigint) => Intl.NumberFormatPart[] ->3000n : 3000n - -new Intl.NumberFormat("fr").formatToParts(BigInt(123)); ->new Intl.NumberFormat("fr").formatToParts(BigInt(123)) : Intl.NumberFormatPart[] ->new Intl.NumberFormat("fr").formatToParts : (number?: number | bigint) => Intl.NumberFormatPart[] ->new Intl.NumberFormat("fr") : Intl.NumberFormat ->Intl.NumberFormat : Intl.NumberFormatConstructor ->Intl : typeof Intl ->NumberFormat : Intl.NumberFormatConstructor ->"fr" : "fr" ->formatToParts : (number?: number | bigint) => Intl.NumberFormatPart[] ->BigInt(123) : bigint ->BigInt : BigIntConstructor ->123 : 123 - diff --git a/tests/baselines/reference/formatToPartsFractionalSecond.symbols b/tests/baselines/reference/formatToPartsFractionalSecond.symbols index 34b86ff0d4d60..8f11bdbf67856 100644 --- a/tests/baselines/reference/formatToPartsFractionalSecond.symbols +++ b/tests/baselines/reference/formatToPartsFractionalSecond.symbols @@ -5,7 +5,7 @@ new Intl.DateTimeFormat().formatToParts().find((val) => val.type === 'fractional >new Intl.DateTimeFormat().formatToParts().find : Symbol(Array.find, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >new Intl.DateTimeFormat().formatToParts : Symbol(Intl.DateTimeFormat.formatToParts, Decl(lib.es2017.intl.d.ts, --, --)) >Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 6 more) >DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) >formatToParts : Symbol(Intl.DateTimeFormat.formatToParts, Decl(lib.es2017.intl.d.ts, --, --)) >find : Symbol(Array.find, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) diff --git a/tests/baselines/reference/intlDateTimeFormatRangeES2021.js b/tests/baselines/reference/intlDateTimeFormatRangeES2021.js new file mode 100644 index 0000000000000..c42c04293fed2 --- /dev/null +++ b/tests/baselines/reference/intlDateTimeFormatRangeES2021.js @@ -0,0 +1,10 @@ +//// [tests/cases/conformance/es2021/intlDateTimeFormatRangeES2021.ts] //// + +//// [intlDateTimeFormatRangeES2021.ts] +new Intl.DateTimeFormat().formatRange(new Date(0), new Date()); +const [ part ] = new Intl.DateTimeFormat().formatRangeToParts(1000, 1000000000); + + +//// [intlDateTimeFormatRangeES2021.js] +new Intl.DateTimeFormat().formatRange(new Date(0), new Date()); +var part = new Intl.DateTimeFormat().formatRangeToParts(1000, 1000000000)[0]; diff --git a/tests/baselines/reference/intlDateTimeFormatRangeES2021.symbols b/tests/baselines/reference/intlDateTimeFormatRangeES2021.symbols new file mode 100644 index 0000000000000..f8d30cfa466a8 --- /dev/null +++ b/tests/baselines/reference/intlDateTimeFormatRangeES2021.symbols @@ -0,0 +1,20 @@ +//// [tests/cases/conformance/es2021/intlDateTimeFormatRangeES2021.ts] //// + +=== intlDateTimeFormatRangeES2021.ts === +new Intl.DateTimeFormat().formatRange(new Date(0), new Date()); +>new Intl.DateTimeFormat().formatRange : Symbol(Intl.DateTimeFormat.formatRange, Decl(lib.es2021.intl.d.ts, --, --)) +>Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) +>DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) +>formatRange : Symbol(Intl.DateTimeFormat.formatRange, Decl(lib.es2021.intl.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2020.date.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2020.date.d.ts, --, --)) + +const [ part ] = new Intl.DateTimeFormat().formatRangeToParts(1000, 1000000000); +>part : Symbol(part, Decl(intlDateTimeFormatRangeES2021.ts, 1, 7)) +>new Intl.DateTimeFormat().formatRangeToParts : Symbol(Intl.DateTimeFormat.formatRangeToParts, Decl(lib.es2021.intl.d.ts, --, --)) +>Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) +>DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) +>formatRangeToParts : Symbol(Intl.DateTimeFormat.formatRangeToParts, Decl(lib.es2021.intl.d.ts, --, --)) + diff --git a/tests/baselines/reference/intlDateTimeFormatRangeES2021.types b/tests/baselines/reference/intlDateTimeFormatRangeES2021.types new file mode 100644 index 0000000000000..2365599a7b392 --- /dev/null +++ b/tests/baselines/reference/intlDateTimeFormatRangeES2021.types @@ -0,0 +1,29 @@ +//// [tests/cases/conformance/es2021/intlDateTimeFormatRangeES2021.ts] //// + +=== intlDateTimeFormatRangeES2021.ts === +new Intl.DateTimeFormat().formatRange(new Date(0), new Date()); +>new Intl.DateTimeFormat().formatRange(new Date(0), new Date()) : string +>new Intl.DateTimeFormat().formatRange : (startDate: number | bigint | Date, endDate: number | bigint | Date) => string +>new Intl.DateTimeFormat() : Intl.DateTimeFormat +>Intl.DateTimeFormat : Intl.DateTimeFormatConstructor +>Intl : typeof Intl +>DateTimeFormat : Intl.DateTimeFormatConstructor +>formatRange : (startDate: number | bigint | Date, endDate: number | bigint | Date) => string +>new Date(0) : Date +>Date : DateConstructor +>0 : 0 +>new Date() : Date +>Date : DateConstructor + +const [ part ] = new Intl.DateTimeFormat().formatRangeToParts(1000, 1000000000); +>part : Intl.DateTimeRangeFormatPart +>new Intl.DateTimeFormat().formatRangeToParts(1000, 1000000000) : Intl.DateTimeRangeFormatPart[] +>new Intl.DateTimeFormat().formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeRangeFormatPart[] +>new Intl.DateTimeFormat() : Intl.DateTimeFormat +>Intl.DateTimeFormat : Intl.DateTimeFormatConstructor +>Intl : typeof Intl +>DateTimeFormat : Intl.DateTimeFormatConstructor +>formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeRangeFormatPart[] +>1000 : 1000 +>1000000000 : 1000000000 + diff --git a/tests/baselines/reference/intlNumberFormatES2020.js b/tests/baselines/reference/intlNumberFormatES2020.js new file mode 100644 index 0000000000000..0182294b853bb --- /dev/null +++ b/tests/baselines/reference/intlNumberFormatES2020.js @@ -0,0 +1,46 @@ +//// [tests/cases/conformance/es2020/intlNumberFormatES2020.ts] //// + +//// [intlNumberFormatES2020.ts] +// New/updated resolved options in ES2020 +const { notation, style, signDisplay } = new Intl.NumberFormat('en-NZ').resolvedOptions(); + +// Empty options +new Intl.NumberFormat('en-NZ', {}); + +// Override numbering system +new Intl.NumberFormat('en-NZ', { numberingSystem: 'arab' }); + +// Currency +const { currency, currencySign } = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions(); + +// Units +const { unit, unitDisplay } = new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions(); + +// Compact +const { compactDisplay } = new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions(); + +// Sign display +new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }); + +// New additions to NumberFormatPartTypes +const types: Intl.NumberFormatPartTypes[] = [ 'compact', 'unit', 'unknown' ]; + + +//// [intlNumberFormatES2020.js] +"use strict"; +// New/updated resolved options in ES2020 +const { notation, style, signDisplay } = new Intl.NumberFormat('en-NZ').resolvedOptions(); +// Empty options +new Intl.NumberFormat('en-NZ', {}); +// Override numbering system +new Intl.NumberFormat('en-NZ', { numberingSystem: 'arab' }); +// Currency +const { currency, currencySign } = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions(); +// Units +const { unit, unitDisplay } = new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions(); +// Compact +const { compactDisplay } = new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions(); +// Sign display +new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }); +// New additions to NumberFormatPartTypes +const types = ['compact', 'unit', 'unknown']; diff --git a/tests/baselines/reference/intlNumberFormatES2020.symbols b/tests/baselines/reference/intlNumberFormatES2020.symbols new file mode 100644 index 0000000000000..06079622297ec --- /dev/null +++ b/tests/baselines/reference/intlNumberFormatES2020.symbols @@ -0,0 +1,77 @@ +//// [tests/cases/conformance/es2020/intlNumberFormatES2020.ts] //// + +=== intlNumberFormatES2020.ts === +// New/updated resolved options in ES2020 +const { notation, style, signDisplay } = new Intl.NumberFormat('en-NZ').resolvedOptions(); +>notation : Symbol(notation, Decl(intlNumberFormatES2020.ts, 1, 7)) +>style : Symbol(style, Decl(intlNumberFormatES2020.ts, 1, 17)) +>signDisplay : Symbol(signDisplay, Decl(intlNumberFormatES2020.ts, 1, 24)) +>new Intl.NumberFormat('en-NZ').resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) + +// Empty options +new Intl.NumberFormat('en-NZ', {}); +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) + +// Override numbering system +new Intl.NumberFormat('en-NZ', { numberingSystem: 'arab' }); +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>numberingSystem : Symbol(numberingSystem, Decl(intlNumberFormatES2020.ts, 7, 32)) + +// Currency +const { currency, currencySign } = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions(); +>currency : Symbol(currency, Decl(intlNumberFormatES2020.ts, 10, 7)) +>currencySign : Symbol(currencySign, Decl(intlNumberFormatES2020.ts, 10, 17)) +>new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>style : Symbol(style, Decl(intlNumberFormatES2020.ts, 10, 67)) +>currency : Symbol(currency, Decl(intlNumberFormatES2020.ts, 10, 86)) +>currencySign : Symbol(currencySign, Decl(intlNumberFormatES2020.ts, 10, 103)) +>resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) + +// Units +const { unit, unitDisplay } = new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions(); +>unit : Symbol(unit, Decl(intlNumberFormatES2020.ts, 13, 7)) +>unitDisplay : Symbol(unitDisplay, Decl(intlNumberFormatES2020.ts, 13, 13)) +>new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>style : Symbol(style, Decl(intlNumberFormatES2020.ts, 13, 62)) +>unit : Symbol(unit, Decl(intlNumberFormatES2020.ts, 13, 77)) +>unitDisplay : Symbol(unitDisplay, Decl(intlNumberFormatES2020.ts, 13, 95)) +>resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) + +// Compact +const { compactDisplay } = new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions(); +>compactDisplay : Symbol(compactDisplay, Decl(intlNumberFormatES2020.ts, 16, 7)) +>new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>notation : Symbol(notation, Decl(intlNumberFormatES2020.ts, 16, 59)) +>compactDisplay : Symbol(compactDisplay, Decl(intlNumberFormatES2020.ts, 16, 80)) +>resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) + +// Sign display +new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }); +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>signDisplay : Symbol(signDisplay, Decl(intlNumberFormatES2020.ts, 19, 32)) + +// New additions to NumberFormatPartTypes +const types: Intl.NumberFormatPartTypes[] = [ 'compact', 'unit', 'unknown' ]; +>types : Symbol(types, Decl(intlNumberFormatES2020.ts, 22, 5)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>NumberFormatPartTypes : Symbol(Intl.NumberFormatPartTypes, Decl(lib.es2018.intl.d.ts, --, --)) + diff --git a/tests/baselines/reference/intlNumberFormatES2020.types b/tests/baselines/reference/intlNumberFormatES2020.types new file mode 100644 index 0000000000000..6f47e4c14548d --- /dev/null +++ b/tests/baselines/reference/intlNumberFormatES2020.types @@ -0,0 +1,114 @@ +//// [tests/cases/conformance/es2020/intlNumberFormatES2020.ts] //// + +=== intlNumberFormatES2020.ts === +// New/updated resolved options in ES2020 +const { notation, style, signDisplay } = new Intl.NumberFormat('en-NZ').resolvedOptions(); +>notation : "standard" | "scientific" | "engineering" | "compact" +>style : keyof Intl.NumberFormatOptionsStyleRegistry +>signDisplay : keyof Intl.NumberFormatOptionsSignDisplayRegistry +>new Intl.NumberFormat('en-NZ').resolvedOptions() : Intl.ResolvedNumberFormatOptions +>new Intl.NumberFormat('en-NZ').resolvedOptions : () => Intl.ResolvedNumberFormatOptions +>new Intl.NumberFormat('en-NZ') : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-NZ' : "en-NZ" +>resolvedOptions : () => Intl.ResolvedNumberFormatOptions + +// Empty options +new Intl.NumberFormat('en-NZ', {}); +>new Intl.NumberFormat('en-NZ', {}) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-NZ' : "en-NZ" +>{} : {} + +// Override numbering system +new Intl.NumberFormat('en-NZ', { numberingSystem: 'arab' }); +>new Intl.NumberFormat('en-NZ', { numberingSystem: 'arab' }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-NZ' : "en-NZ" +>{ numberingSystem: 'arab' } : { numberingSystem: string; } +>numberingSystem : string +>'arab' : "arab" + +// Currency +const { currency, currencySign } = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions(); +>currency : string | undefined +>currencySign : "standard" | "accounting" | undefined +>new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions() : Intl.ResolvedNumberFormatOptions +>new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions : () => Intl.ResolvedNumberFormatOptions +>new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-NZ' : "en-NZ" +>{ style: 'currency', currency: 'NZD', currencySign: 'accounting' } : { style: "currency"; currency: string; currencySign: "accounting"; } +>style : "currency" +>'currency' : "currency" +>currency : string +>'NZD' : "NZD" +>currencySign : "accounting" +>'accounting' : "accounting" +>resolvedOptions : () => Intl.ResolvedNumberFormatOptions + +// Units +const { unit, unitDisplay } = new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions(); +>unit : string | undefined +>unitDisplay : "short" | "long" | "narrow" | undefined +>new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions() : Intl.ResolvedNumberFormatOptions +>new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions : () => Intl.ResolvedNumberFormatOptions +>new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-NZ' : "en-NZ" +>{ style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' } : { style: "unit"; unit: string; unitDisplay: "narrow"; } +>style : "unit" +>'unit' : "unit" +>unit : string +>'kilogram' : "kilogram" +>unitDisplay : "narrow" +>'narrow' : "narrow" +>resolvedOptions : () => Intl.ResolvedNumberFormatOptions + +// Compact +const { compactDisplay } = new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions(); +>compactDisplay : "short" | "long" | undefined +>new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions() : Intl.ResolvedNumberFormatOptions +>new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions : () => Intl.ResolvedNumberFormatOptions +>new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-NZ' : "en-NZ" +>{ notation: 'compact', compactDisplay: 'long' } : { notation: "compact"; compactDisplay: "long"; } +>notation : "compact" +>'compact' : "compact" +>compactDisplay : "long" +>'long' : "long" +>resolvedOptions : () => Intl.ResolvedNumberFormatOptions + +// Sign display +new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }); +>new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-NZ' : "en-NZ" +>{ signDisplay: 'always' } : { signDisplay: "always"; } +>signDisplay : "always" +>'always' : "always" + +// New additions to NumberFormatPartTypes +const types: Intl.NumberFormatPartTypes[] = [ 'compact', 'unit', 'unknown' ]; +>types : (keyof Intl.NumberFormatPartTypeRegistry)[] +>Intl : any +>[ 'compact', 'unit', 'unknown' ] : ("compact" | "unit" | "unknown")[] +>'compact' : "compact" +>'unit' : "unit" +>'unknown' : "unknown" + diff --git a/tests/baselines/reference/intlNumberFormatES2023.js b/tests/baselines/reference/intlNumberFormatES2023.js new file mode 100644 index 0000000000000..f9ab2faef8b59 --- /dev/null +++ b/tests/baselines/reference/intlNumberFormatES2023.js @@ -0,0 +1,46 @@ +//// [tests/cases/conformance/es2023/intlNumberFormatES2023.ts] //// + +//// [intlNumberFormatES2023.ts] +// New / updated resolved options in ES2023, including type change for useGrouping +const { roundingPriority, roundingMode, roundingIncrement, trailingZeroDisplay, useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); + +// Empty options +new Intl.NumberFormat('en-GB', {}); + +// Rounding +new Intl.NumberFormat('en-GB', { roundingPriority: 'lessPrecision', roundingIncrement: 100, roundingMode: 'trunc' }); + +// Changes to signDisplay +const { signDisplay } = new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions(); + +// Changes to useGrouping +new Intl.NumberFormat('en-GB', { useGrouping: true }); +new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); +new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); + +// formatRange +new Intl.NumberFormat('en-GB').formatRange(10, 100); +new Intl.NumberFormat('en-GB').formatRange(10n, 1000n); +new Intl.NumberFormat('en-GB').formatRangeToParts(10, 1000)[0]; +new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0]; + + +//// [intlNumberFormatES2023.js] +"use strict"; +// New / updated resolved options in ES2023, including type change for useGrouping +const { roundingPriority, roundingMode, roundingIncrement, trailingZeroDisplay, useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); +// Empty options +new Intl.NumberFormat('en-GB', {}); +// Rounding +new Intl.NumberFormat('en-GB', { roundingPriority: 'lessPrecision', roundingIncrement: 100, roundingMode: 'trunc' }); +// Changes to signDisplay +const { signDisplay } = new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions(); +// Changes to useGrouping +new Intl.NumberFormat('en-GB', { useGrouping: true }); +new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); +new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); +// formatRange +new Intl.NumberFormat('en-GB').formatRange(10, 100); +new Intl.NumberFormat('en-GB').formatRange(10n, 1000n); +new Intl.NumberFormat('en-GB').formatRangeToParts(10, 1000)[0]; +new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0]; diff --git a/tests/baselines/reference/intlNumberFormatES2023.symbols b/tests/baselines/reference/intlNumberFormatES2023.symbols new file mode 100644 index 0000000000000..ecc1738f1d714 --- /dev/null +++ b/tests/baselines/reference/intlNumberFormatES2023.symbols @@ -0,0 +1,89 @@ +//// [tests/cases/conformance/es2023/intlNumberFormatES2023.ts] //// + +=== intlNumberFormatES2023.ts === +// New / updated resolved options in ES2023, including type change for useGrouping +const { roundingPriority, roundingMode, roundingIncrement, trailingZeroDisplay, useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); +>roundingPriority : Symbol(roundingPriority, Decl(intlNumberFormatES2023.ts, 1, 7)) +>roundingMode : Symbol(roundingMode, Decl(intlNumberFormatES2023.ts, 1, 25)) +>roundingIncrement : Symbol(roundingIncrement, Decl(intlNumberFormatES2023.ts, 1, 39)) +>trailingZeroDisplay : Symbol(trailingZeroDisplay, Decl(intlNumberFormatES2023.ts, 1, 58)) +>useGrouping : Symbol(useGrouping, Decl(intlNumberFormatES2023.ts, 1, 79)) +>new Intl.NumberFormat('en-GB').resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) + +// Empty options +new Intl.NumberFormat('en-GB', {}); +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) + +// Rounding +new Intl.NumberFormat('en-GB', { roundingPriority: 'lessPrecision', roundingIncrement: 100, roundingMode: 'trunc' }); +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>roundingPriority : Symbol(roundingPriority, Decl(intlNumberFormatES2023.ts, 7, 32)) +>roundingIncrement : Symbol(roundingIncrement, Decl(intlNumberFormatES2023.ts, 7, 67)) +>roundingMode : Symbol(roundingMode, Decl(intlNumberFormatES2023.ts, 7, 91)) + +// Changes to signDisplay +const { signDisplay } = new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions(); +>signDisplay : Symbol(signDisplay, Decl(intlNumberFormatES2023.ts, 10, 7)) +>new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>signDisplay : Symbol(signDisplay, Decl(intlNumberFormatES2023.ts, 10, 56)) +>resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) + +// Changes to useGrouping +new Intl.NumberFormat('en-GB', { useGrouping: true }); +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>useGrouping : Symbol(useGrouping, Decl(intlNumberFormatES2023.ts, 13, 32)) + +new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>useGrouping : Symbol(useGrouping, Decl(intlNumberFormatES2023.ts, 14, 32)) + +new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>useGrouping : Symbol(useGrouping, Decl(intlNumberFormatES2023.ts, 15, 32)) + +// formatRange +new Intl.NumberFormat('en-GB').formatRange(10, 100); +>new Intl.NumberFormat('en-GB').formatRange : Symbol(Intl.NumberFormat.formatRange, Decl(lib.es2023.intl.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>formatRange : Symbol(Intl.NumberFormat.formatRange, Decl(lib.es2023.intl.d.ts, --, --)) + +new Intl.NumberFormat('en-GB').formatRange(10n, 1000n); +>new Intl.NumberFormat('en-GB').formatRange : Symbol(Intl.NumberFormat.formatRange, Decl(lib.es2023.intl.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>formatRange : Symbol(Intl.NumberFormat.formatRange, Decl(lib.es2023.intl.d.ts, --, --)) + +new Intl.NumberFormat('en-GB').formatRangeToParts(10, 1000)[0]; +>new Intl.NumberFormat('en-GB').formatRangeToParts : Symbol(Intl.NumberFormat.formatRangeToParts, Decl(lib.es2023.intl.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>formatRangeToParts : Symbol(Intl.NumberFormat.formatRangeToParts, Decl(lib.es2023.intl.d.ts, --, --)) + +new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0]; +>new Intl.NumberFormat('en-GB').formatRangeToParts : Symbol(Intl.NumberFormat.formatRangeToParts, Decl(lib.es2023.intl.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>formatRangeToParts : Symbol(Intl.NumberFormat.formatRangeToParts, Decl(lib.es2023.intl.d.ts, --, --)) + diff --git a/tests/baselines/reference/intlNumberFormatES2023.types b/tests/baselines/reference/intlNumberFormatES2023.types new file mode 100644 index 0000000000000..8e75f8967b133 --- /dev/null +++ b/tests/baselines/reference/intlNumberFormatES2023.types @@ -0,0 +1,142 @@ +//// [tests/cases/conformance/es2023/intlNumberFormatES2023.ts] //// + +=== intlNumberFormatES2023.ts === +// New / updated resolved options in ES2023, including type change for useGrouping +const { roundingPriority, roundingMode, roundingIncrement, trailingZeroDisplay, useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); +>roundingPriority : "auto" | "morePrecision" | "lessPrecision" +>roundingMode : "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven" +>roundingIncrement : 1 | 2 | 5 | 10 | 20 | 25 | 50 | 100 | 200 | 250 | 500 | 1000 | 2000 | 2500 | 5000 +>trailingZeroDisplay : "auto" | "stripIfInteger" +>useGrouping : false | keyof Intl.NumberFormatOptionsUseGroupingRegistry +>new Intl.NumberFormat('en-GB').resolvedOptions() : Intl.ResolvedNumberFormatOptions +>new Intl.NumberFormat('en-GB').resolvedOptions : () => Intl.ResolvedNumberFormatOptions +>new Intl.NumberFormat('en-GB') : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>resolvedOptions : () => Intl.ResolvedNumberFormatOptions + +// Empty options +new Intl.NumberFormat('en-GB', {}); +>new Intl.NumberFormat('en-GB', {}) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>{} : {} + +// Rounding +new Intl.NumberFormat('en-GB', { roundingPriority: 'lessPrecision', roundingIncrement: 100, roundingMode: 'trunc' }); +>new Intl.NumberFormat('en-GB', { roundingPriority: 'lessPrecision', roundingIncrement: 100, roundingMode: 'trunc' }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>{ roundingPriority: 'lessPrecision', roundingIncrement: 100, roundingMode: 'trunc' } : { roundingPriority: "lessPrecision"; roundingIncrement: 100; roundingMode: "trunc"; } +>roundingPriority : "lessPrecision" +>'lessPrecision' : "lessPrecision" +>roundingIncrement : 100 +>100 : 100 +>roundingMode : "trunc" +>'trunc' : "trunc" + +// Changes to signDisplay +const { signDisplay } = new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions(); +>signDisplay : keyof Intl.NumberFormatOptionsSignDisplayRegistry +>new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions() : Intl.ResolvedNumberFormatOptions +>new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions : () => Intl.ResolvedNumberFormatOptions +>new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>{ signDisplay: 'negative' } : { signDisplay: "negative"; } +>signDisplay : "negative" +>'negative' : "negative" +>resolvedOptions : () => Intl.ResolvedNumberFormatOptions + +// Changes to useGrouping +new Intl.NumberFormat('en-GB', { useGrouping: true }); +>new Intl.NumberFormat('en-GB', { useGrouping: true }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>{ useGrouping: true } : { useGrouping: true; } +>useGrouping : true +>true : true + +new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); +>new Intl.NumberFormat('en-GB', { useGrouping: 'true' }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>{ useGrouping: 'true' } : { useGrouping: "true"; } +>useGrouping : "true" +>'true' : "true" + +new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); +>new Intl.NumberFormat('en-GB', { useGrouping: 'always' }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>{ useGrouping: 'always' } : { useGrouping: "always"; } +>useGrouping : "always" +>'always' : "always" + +// formatRange +new Intl.NumberFormat('en-GB').formatRange(10, 100); +>new Intl.NumberFormat('en-GB').formatRange(10, 100) : string +>new Intl.NumberFormat('en-GB').formatRange : (start: number | bigint, end: number | bigint) => string +>new Intl.NumberFormat('en-GB') : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>formatRange : (start: number | bigint, end: number | bigint) => string +>10 : 10 +>100 : 100 + +new Intl.NumberFormat('en-GB').formatRange(10n, 1000n); +>new Intl.NumberFormat('en-GB').formatRange(10n, 1000n) : string +>new Intl.NumberFormat('en-GB').formatRange : (start: number | bigint, end: number | bigint) => string +>new Intl.NumberFormat('en-GB') : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>formatRange : (start: number | bigint, end: number | bigint) => string +>10n : 10n +>1000n : 1000n + +new Intl.NumberFormat('en-GB').formatRangeToParts(10, 1000)[0]; +>new Intl.NumberFormat('en-GB').formatRangeToParts(10, 1000)[0] : Intl.NumberRangeFormatPart +>new Intl.NumberFormat('en-GB').formatRangeToParts(10, 1000) : Intl.NumberRangeFormatPart[] +>new Intl.NumberFormat('en-GB').formatRangeToParts : (start: number | bigint, end: number | bigint) => Intl.NumberRangeFormatPart[] +>new Intl.NumberFormat('en-GB') : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>formatRangeToParts : (start: number | bigint, end: number | bigint) => Intl.NumberRangeFormatPart[] +>10 : 10 +>1000 : 1000 +>0 : 0 + +new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0]; +>new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0] : Intl.NumberRangeFormatPart +>new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n) : Intl.NumberRangeFormatPart[] +>new Intl.NumberFormat('en-GB').formatRangeToParts : (start: number | bigint, end: number | bigint) => Intl.NumberRangeFormatPart[] +>new Intl.NumberFormat('en-GB') : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>formatRangeToParts : (start: number | bigint, end: number | bigint) => Intl.NumberRangeFormatPart[] +>10n : 10n +>1000n : 1000n +>0 : 0 + diff --git a/tests/baselines/reference/intlNumberFormatES5UseGrouping.errors.txt b/tests/baselines/reference/intlNumberFormatES5UseGrouping.errors.txt new file mode 100644 index 0000000000000..cd22de47d6941 --- /dev/null +++ b/tests/baselines/reference/intlNumberFormatES5UseGrouping.errors.txt @@ -0,0 +1,15 @@ +intlNumberFormatES5UseGrouping.ts(2,34): error TS2322: Type 'string' is not assignable to type 'boolean | undefined'. +intlNumberFormatES5UseGrouping.ts(3,34): error TS2322: Type 'string' is not assignable to type 'boolean | undefined'. + + +==== intlNumberFormatES5UseGrouping.ts (2 errors) ==== + new Intl.NumberFormat('en-GB', { useGrouping: true }); + new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); // expect error + ~~~~~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'boolean | undefined'. + new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); // expect error + ~~~~~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'boolean | undefined'. + + const { useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); + \ No newline at end of file diff --git a/tests/baselines/reference/intlNumberFormatES5UseGrouping.js b/tests/baselines/reference/intlNumberFormatES5UseGrouping.js new file mode 100644 index 0000000000000..b1162dfbfe59a --- /dev/null +++ b/tests/baselines/reference/intlNumberFormatES5UseGrouping.js @@ -0,0 +1,16 @@ +//// [tests/cases/conformance/es2023/intlNumberFormatES5UseGrouping.ts] //// + +//// [intlNumberFormatES5UseGrouping.ts] +new Intl.NumberFormat('en-GB', { useGrouping: true }); +new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); // expect error +new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); // expect error + +const { useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); + + +//// [intlNumberFormatES5UseGrouping.js] +"use strict"; +new Intl.NumberFormat('en-GB', { useGrouping: true }); +new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); // expect error +new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); // expect error +var useGrouping = new Intl.NumberFormat('en-GB').resolvedOptions().useGrouping; diff --git a/tests/baselines/reference/intlNumberFormatES5UseGrouping.symbols b/tests/baselines/reference/intlNumberFormatES5UseGrouping.symbols new file mode 100644 index 0000000000000..ef972a7c1efbb --- /dev/null +++ b/tests/baselines/reference/intlNumberFormatES5UseGrouping.symbols @@ -0,0 +1,29 @@ +//// [tests/cases/conformance/es2023/intlNumberFormatES5UseGrouping.ts] //// + +=== intlNumberFormatES5UseGrouping.ts === +new Intl.NumberFormat('en-GB', { useGrouping: true }); +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --)) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>useGrouping : Symbol(useGrouping, Decl(intlNumberFormatES5UseGrouping.ts, 0, 32)) + +new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); // expect error +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --)) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>useGrouping : Symbol(useGrouping, Decl(intlNumberFormatES5UseGrouping.ts, 1, 32)) + +new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); // expect error +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --)) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>useGrouping : Symbol(useGrouping, Decl(intlNumberFormatES5UseGrouping.ts, 2, 32)) + +const { useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); +>useGrouping : Symbol(useGrouping, Decl(intlNumberFormatES5UseGrouping.ts, 4, 7)) +>new Intl.NumberFormat('en-GB').resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --)) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) + diff --git a/tests/baselines/reference/intlNumberFormatES5UseGrouping.types b/tests/baselines/reference/intlNumberFormatES5UseGrouping.types new file mode 100644 index 0000000000000..c96a5ed0aee33 --- /dev/null +++ b/tests/baselines/reference/intlNumberFormatES5UseGrouping.types @@ -0,0 +1,44 @@ +//// [tests/cases/conformance/es2023/intlNumberFormatES5UseGrouping.ts] //// + +=== intlNumberFormatES5UseGrouping.ts === +new Intl.NumberFormat('en-GB', { useGrouping: true }); +>new Intl.NumberFormat('en-GB', { useGrouping: true }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>{ useGrouping: true } : { useGrouping: true; } +>useGrouping : true +>true : true + +new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); // expect error +>new Intl.NumberFormat('en-GB', { useGrouping: 'true' }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>{ useGrouping: 'true' } : { useGrouping: string; } +>useGrouping : string +>'true' : "true" + +new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); // expect error +>new Intl.NumberFormat('en-GB', { useGrouping: 'always' }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>{ useGrouping: 'always' } : { useGrouping: string; } +>useGrouping : string +>'always' : "always" + +const { useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); +>useGrouping : boolean +>new Intl.NumberFormat('en-GB').resolvedOptions() : Intl.ResolvedNumberFormatOptions +>new Intl.NumberFormat('en-GB').resolvedOptions : () => Intl.ResolvedNumberFormatOptions +>new Intl.NumberFormat('en-GB') : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>resolvedOptions : () => Intl.ResolvedNumberFormatOptions + diff --git a/tests/baselines/reference/modulePreserve2.trace.json b/tests/baselines/reference/modulePreserve2.trace.json index e8f128fcc1462..01545c5e0ce12 100644 --- a/tests/baselines/reference/modulePreserve2.trace.json +++ b/tests/baselines/reference/modulePreserve2.trace.json @@ -767,6 +767,18 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-es2023/collection' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/intl' was not resolved. ========", "======== Resolving module '@typescript/lib-esnext/intl' from '/.src/__lib_node_modules_lookup_lib.esnext.intl.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", diff --git a/tests/baselines/reference/modulePreserve3.trace.json b/tests/baselines/reference/modulePreserve3.trace.json index 35f43171f4a04..5e0efc633da60 100644 --- a/tests/baselines/reference/modulePreserve3.trace.json +++ b/tests/baselines/reference/modulePreserve3.trace.json @@ -705,6 +705,17 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-es2023/collection' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/intl' was not resolved. ========", "======== Resolving module '@typescript/lib-esnext/intl' from '/.src/__lib_node_modules_lookup_lib.esnext.intl.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", diff --git a/tests/baselines/reference/numberFormatCurrencySign.js b/tests/baselines/reference/numberFormatCurrencySign.js deleted file mode 100644 index 4579848f74f25..0000000000000 --- a/tests/baselines/reference/numberFormatCurrencySign.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [tests/cases/conformance/es2020/numberFormatCurrencySign.ts] //// - -//// [numberFormatCurrencySign.ts] -const str = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format(999999); - - -//// [numberFormatCurrencySign.js] -"use strict"; -const str = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format(999999); diff --git a/tests/baselines/reference/numberFormatCurrencySign.symbols b/tests/baselines/reference/numberFormatCurrencySign.symbols deleted file mode 100644 index c473f016b2187..0000000000000 --- a/tests/baselines/reference/numberFormatCurrencySign.symbols +++ /dev/null @@ -1,14 +0,0 @@ -//// [tests/cases/conformance/es2020/numberFormatCurrencySign.ts] //// - -=== numberFormatCurrencySign.ts === -const str = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format(999999); ->str : Symbol(str, Decl(numberFormatCurrencySign.ts, 0, 5)) ->new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format : Symbol(Intl.NumberFormat.format, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) ->Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) ->NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) ->style : Symbol(style, Decl(numberFormatCurrencySign.ts, 0, 44)) ->currency : Symbol(currency, Decl(numberFormatCurrencySign.ts, 0, 63)) ->currencySign : Symbol(currencySign, Decl(numberFormatCurrencySign.ts, 0, 80)) ->format : Symbol(Intl.NumberFormat.format, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) - diff --git a/tests/baselines/reference/numberFormatCurrencySign.types b/tests/baselines/reference/numberFormatCurrencySign.types deleted file mode 100644 index b61cddf872e5a..0000000000000 --- a/tests/baselines/reference/numberFormatCurrencySign.types +++ /dev/null @@ -1,22 +0,0 @@ -//// [tests/cases/conformance/es2020/numberFormatCurrencySign.ts] //// - -=== numberFormatCurrencySign.ts === -const str = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format(999999); ->str : string ->new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format(999999) : string ->new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format : { (value: number): string; (value: number | bigint): string; } ->new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }) : Intl.NumberFormat ->Intl.NumberFormat : Intl.NumberFormatConstructor ->Intl : typeof Intl ->NumberFormat : Intl.NumberFormatConstructor ->'en-NZ' : "en-NZ" ->{ style: 'currency', currency: 'NZD', currencySign: 'accounting' } : { style: string; currency: string; currencySign: string; } ->style : string ->'currency' : "currency" ->currency : string ->'NZD' : "NZD" ->currencySign : string ->'accounting' : "accounting" ->format : { (value: number): string; (value: number | bigint): string; } ->999999 : 999999 - diff --git a/tests/baselines/reference/numberFormatCurrencySignResolved.js b/tests/baselines/reference/numberFormatCurrencySignResolved.js deleted file mode 100644 index 4d7bcc5a8c432..0000000000000 --- a/tests/baselines/reference/numberFormatCurrencySignResolved.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [tests/cases/conformance/es2020/numberFormatCurrencySignResolved.ts] //// - -//// [numberFormatCurrencySignResolved.ts] -const options = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions(); -const currencySign = options.currencySign; - - -//// [numberFormatCurrencySignResolved.js] -"use strict"; -const options = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions(); -const currencySign = options.currencySign; diff --git a/tests/baselines/reference/numberFormatCurrencySignResolved.symbols b/tests/baselines/reference/numberFormatCurrencySignResolved.symbols deleted file mode 100644 index bf424c8b4fbc2..0000000000000 --- a/tests/baselines/reference/numberFormatCurrencySignResolved.symbols +++ /dev/null @@ -1,20 +0,0 @@ -//// [tests/cases/conformance/es2020/numberFormatCurrencySignResolved.ts] //// - -=== numberFormatCurrencySignResolved.ts === -const options = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions(); ->options : Symbol(options, Decl(numberFormatCurrencySignResolved.ts, 0, 5)) ->new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) ->Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) ->NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) ->style : Symbol(style, Decl(numberFormatCurrencySignResolved.ts, 0, 48)) ->currency : Symbol(currency, Decl(numberFormatCurrencySignResolved.ts, 0, 67)) ->currencySign : Symbol(currencySign, Decl(numberFormatCurrencySignResolved.ts, 0, 84)) ->resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) - -const currencySign = options.currencySign; ->currencySign : Symbol(currencySign, Decl(numberFormatCurrencySignResolved.ts, 1, 5)) ->options.currencySign : Symbol(Intl.ResolvedNumberFormatOptions.currencySign, Decl(lib.es2020.intl.d.ts, --, --)) ->options : Symbol(options, Decl(numberFormatCurrencySignResolved.ts, 0, 5)) ->currencySign : Symbol(Intl.ResolvedNumberFormatOptions.currencySign, Decl(lib.es2020.intl.d.ts, --, --)) - diff --git a/tests/baselines/reference/numberFormatCurrencySignResolved.types b/tests/baselines/reference/numberFormatCurrencySignResolved.types deleted file mode 100644 index 75102f726cb0b..0000000000000 --- a/tests/baselines/reference/numberFormatCurrencySignResolved.types +++ /dev/null @@ -1,27 +0,0 @@ -//// [tests/cases/conformance/es2020/numberFormatCurrencySignResolved.ts] //// - -=== numberFormatCurrencySignResolved.ts === -const options = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions(); ->options : Intl.ResolvedNumberFormatOptions ->new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions() : Intl.ResolvedNumberFormatOptions ->new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } ->new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }) : Intl.NumberFormat ->Intl.NumberFormat : Intl.NumberFormatConstructor ->Intl : typeof Intl ->NumberFormat : Intl.NumberFormatConstructor ->'en-NZ' : "en-NZ" ->{ style: 'currency', currency: 'NZD', currencySign: 'accounting' } : { style: string; currency: string; currencySign: string; } ->style : string ->'currency' : "currency" ->currency : string ->'NZD' : "NZD" ->currencySign : string ->'accounting' : "accounting" ->resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } - -const currencySign = options.currencySign; ->currencySign : string | undefined ->options.currencySign : string | undefined ->options : Intl.ResolvedNumberFormatOptions ->currencySign : string | undefined - diff --git a/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js b/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js index 1ac36252291bd..9f80db5a31e17 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js @@ -111,7 +111,7 @@ default: undefined --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.sharedmemory, es2022.string/esnext.string, es2022.regexp, es2023.array/esnext.array, es2023.collection, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.object, decorators, decorators.legacy +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.sharedmemory, es2022.string/esnext.string, es2022.regexp, es2023.array/esnext.array, es2023.collection, es2023.intl, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.object, decorators, decorators.legacy default: undefined --allowJs diff --git a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js index c25ee96339693..bad435e6304cc 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js @@ -111,7 +111,7 @@ default: undefined --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.sharedmemory, es2022.string/esnext.string, es2022.regexp, es2023.array/esnext.array, es2023.collection, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.object, decorators, decorators.legacy +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.sharedmemory, es2022.string/esnext.string, es2022.regexp, es2023.array/esnext.array, es2023.collection, es2023.intl, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.object, decorators, decorators.legacy default: undefined --allowJs diff --git a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js index c25ee96339693..bad435e6304cc 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js @@ -111,7 +111,7 @@ default: undefined --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.sharedmemory, es2022.string/esnext.string, es2022.regexp, es2023.array/esnext.array, es2023.collection, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.object, decorators, decorators.legacy +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.sharedmemory, es2022.string/esnext.string, es2022.regexp, es2023.array/esnext.array, es2023.collection, es2023.intl, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.object, decorators, decorators.legacy default: undefined --allowJs diff --git a/tests/baselines/reference/tsserver/telemetry/does-not-expose-paths.js b/tests/baselines/reference/tsserver/telemetry/does-not-expose-paths.js index 05d603a27fee1..4e1a0bc657e9e 100644 --- a/tests/baselines/reference/tsserver/telemetry/does-not-expose-paths.js +++ b/tests/baselines/reference/tsserver/telemetry/does-not-expose-paths.js @@ -471,7 +471,7 @@ Info seq [hh:mm:ss:mss] event: "line": 34, "offset": 16 }, - "text": "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'.", + "text": "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'decorators', 'decorators.legacy'.", "code": 6046, "category": "error", "fileName": "/tsconfig.json" diff --git a/tests/baselines/reference/typesVersions.ambientModules.trace.json b/tests/baselines/reference/typesVersions.ambientModules.trace.json index 404be1ddac69b..efc646e090e15 100644 --- a/tests/baselines/reference/typesVersions.ambientModules.trace.json +++ b/tests/baselines/reference/typesVersions.ambientModules.trace.json @@ -804,6 +804,18 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-es2023/collection' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/intl' was not resolved. ========", "======== Resolving module '@typescript/lib-esnext/intl' from '/.src/__lib_node_modules_lookup_lib.esnext.intl.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", diff --git a/tests/baselines/reference/typesVersions.emptyTypes.trace.json b/tests/baselines/reference/typesVersions.emptyTypes.trace.json index 1860a9288d301..45be6aea25277 100644 --- a/tests/baselines/reference/typesVersions.emptyTypes.trace.json +++ b/tests/baselines/reference/typesVersions.emptyTypes.trace.json @@ -814,6 +814,19 @@ "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-es2023/collection' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/intl' was not resolved. ========", "======== Resolving module '@typescript/lib-esnext/intl' from '/.src/__lib_node_modules_lookup_lib.esnext.intl.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", diff --git a/tests/baselines/reference/typesVersions.justIndex.trace.json b/tests/baselines/reference/typesVersions.justIndex.trace.json index c027d7ee5f121..d441a0b7857f8 100644 --- a/tests/baselines/reference/typesVersions.justIndex.trace.json +++ b/tests/baselines/reference/typesVersions.justIndex.trace.json @@ -814,6 +814,19 @@ "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-es2023/collection' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/intl' was not resolved. ========", "======== Resolving module '@typescript/lib-esnext/intl' from '/.src/__lib_node_modules_lookup_lib.esnext.intl.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", diff --git a/tests/baselines/reference/typesVersions.multiFile.trace.json b/tests/baselines/reference/typesVersions.multiFile.trace.json index 533725ea68f2d..7190e7021db2b 100644 --- a/tests/baselines/reference/typesVersions.multiFile.trace.json +++ b/tests/baselines/reference/typesVersions.multiFile.trace.json @@ -765,6 +765,18 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-es2023/collection' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/intl' was not resolved. ========", "======== Resolving module '@typescript/lib-esnext/intl' from '/.src/__lib_node_modules_lookup_lib.esnext.intl.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", diff --git a/tests/baselines/reference/typesVersionsDeclarationEmit.ambient.trace.json b/tests/baselines/reference/typesVersionsDeclarationEmit.ambient.trace.json index 404be1ddac69b..efc646e090e15 100644 --- a/tests/baselines/reference/typesVersionsDeclarationEmit.ambient.trace.json +++ b/tests/baselines/reference/typesVersionsDeclarationEmit.ambient.trace.json @@ -804,6 +804,18 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-es2023/collection' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/intl' was not resolved. ========", "======== Resolving module '@typescript/lib-esnext/intl' from '/.src/__lib_node_modules_lookup_lib.esnext.intl.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", diff --git a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFile.trace.json b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFile.trace.json index 533725ea68f2d..7190e7021db2b 100644 --- a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFile.trace.json +++ b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFile.trace.json @@ -765,6 +765,18 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-es2023/collection' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/intl' was not resolved. ========", "======== Resolving module '@typescript/lib-esnext/intl' from '/.src/__lib_node_modules_lookup_lib.esnext.intl.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", diff --git a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToSelf.trace.json b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToSelf.trace.json index a84c6cc085223..d6880e752af8b 100644 --- a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToSelf.trace.json +++ b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToSelf.trace.json @@ -788,6 +788,18 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-es2023/collection' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/intl' was not resolved. ========", "======== Resolving module '@typescript/lib-esnext/intl' from '/.src/__lib_node_modules_lookup_lib.esnext.intl.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", diff --git a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToUnmapped.trace.json b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToUnmapped.trace.json index 50d0ecbeb1d53..73d8a5a92801b 100644 --- a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToUnmapped.trace.json +++ b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToUnmapped.trace.json @@ -771,6 +771,18 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-es2023/collection' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/intl' was not resolved. ========", "======== Resolving module '@typescript/lib-esnext/intl' from '/.src/__lib_node_modules_lookup_lib.esnext.intl.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", diff --git a/tests/cases/compiler/DateTimeFormatAndNumberFormatES2021.ts b/tests/cases/compiler/DateTimeFormatAndNumberFormatES2021.ts deleted file mode 100644 index 0ad9eca72e850..0000000000000 --- a/tests/cases/compiler/DateTimeFormatAndNumberFormatES2021.ts +++ /dev/null @@ -1,8 +0,0 @@ -// @lib: es2021 -Intl.NumberFormat.prototype.formatRange -Intl.DateTimeFormat.prototype.formatRange - -new Intl.NumberFormat().formatRange -new Intl.NumberFormat().formatRangeToParts -new Intl.DateTimeFormat().formatRange -new Intl.DateTimeFormat().formatRangeToParts \ No newline at end of file diff --git a/tests/cases/compiler/esnext.bigintIncludesNumberFormatPartTypes.ts b/tests/cases/compiler/esnext.bigintIncludesNumberFormatPartTypes.ts deleted file mode 100644 index 7e2aae31ea479..0000000000000 --- a/tests/cases/compiler/esnext.bigintIncludesNumberFormatPartTypes.ts +++ /dev/null @@ -1,3 +0,0 @@ -// @lib: es6 -/// -var t: Intl.NumberFormatPartTypes diff --git a/tests/cases/compiler/formatToPartsBigInt.ts b/tests/cases/compiler/formatToPartsBigInt.ts deleted file mode 100644 index 6b50e98b8b6ea..0000000000000 --- a/tests/cases/compiler/formatToPartsBigInt.ts +++ /dev/null @@ -1,7 +0,0 @@ -// @target: esnext - -// Intl.NumberFormat.formatToParts should support bigInt - -// Test Intl methods with new parameter type -new Intl.NumberFormat("fr").formatToParts(3000n); -new Intl.NumberFormat("fr").formatToParts(BigInt(123)); diff --git a/tests/cases/conformance/es2018/es2018IntlAPIs.ts b/tests/cases/conformance/es2018/es2018IntlAPIs.ts index c1f6739202d72..d09e8fd96a9e4 100644 --- a/tests/cases/conformance/es2018/es2018IntlAPIs.ts +++ b/tests/cases/conformance/es2018/es2018IntlAPIs.ts @@ -1,7 +1,10 @@ -// @target: es2018 - -// Sample from -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/PluralRules/supportedLocalesOf -const locales = ['ban', 'id-u-co-pinyin', 'de-ID']; -const options = { localeMatcher: 'lookup' } as const; -console.log(Intl.PluralRules.supportedLocalesOf(locales, options).join(', ')); \ No newline at end of file +// @target: es2018 + +// Sample from +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/PluralRules/supportedLocalesOf +const locales = ['ban', 'id-u-co-pinyin', 'de-ID']; +const options = { localeMatcher: 'lookup' } as const; +console.log(Intl.PluralRules.supportedLocalesOf(locales, options).join(', ')); + +const [ part ] = new Intl.NumberFormat().formatToParts(); +console.log(part.type, part.value); diff --git a/tests/cases/conformance/es2020/intlNumberFormatES2020.ts b/tests/cases/conformance/es2020/intlNumberFormatES2020.ts new file mode 100644 index 0000000000000..ee616da700167 --- /dev/null +++ b/tests/cases/conformance/es2020/intlNumberFormatES2020.ts @@ -0,0 +1,26 @@ +// @target: es2020 +// @strict: true + +// New/updated resolved options in ES2020 +const { notation, style, signDisplay } = new Intl.NumberFormat('en-NZ').resolvedOptions(); + +// Empty options +new Intl.NumberFormat('en-NZ', {}); + +// Override numbering system +new Intl.NumberFormat('en-NZ', { numberingSystem: 'arab' }); + +// Currency +const { currency, currencySign } = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions(); + +// Units +const { unit, unitDisplay } = new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions(); + +// Compact +const { compactDisplay } = new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions(); + +// Sign display +new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }); + +// New additions to NumberFormatPartTypes +const types: Intl.NumberFormatPartTypes[] = [ 'compact', 'unit', 'unknown' ]; diff --git a/tests/cases/conformance/es2020/numberFormatCurrencySign.ts b/tests/cases/conformance/es2020/numberFormatCurrencySign.ts deleted file mode 100644 index b7b451150d09d..0000000000000 --- a/tests/cases/conformance/es2020/numberFormatCurrencySign.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @target: esnext -// @lib: esnext -// @strict: true -const str = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format(999999); diff --git a/tests/cases/conformance/es2020/numberFormatCurrencySignResolved.ts b/tests/cases/conformance/es2020/numberFormatCurrencySignResolved.ts deleted file mode 100644 index ce6c36fb19fe1..0000000000000 --- a/tests/cases/conformance/es2020/numberFormatCurrencySignResolved.ts +++ /dev/null @@ -1,5 +0,0 @@ -// @target: esnext -// @lib: esnext -// @strict: true -const options = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions(); -const currencySign = options.currencySign; diff --git a/tests/cases/conformance/es2021/intlDateTimeFormatRangeES2021.ts b/tests/cases/conformance/es2021/intlDateTimeFormatRangeES2021.ts new file mode 100644 index 0000000000000..2d318dfccba6f --- /dev/null +++ b/tests/cases/conformance/es2021/intlDateTimeFormatRangeES2021.ts @@ -0,0 +1,4 @@ +// @lib: es2021 + +new Intl.DateTimeFormat().formatRange(new Date(0), new Date()); +const [ part ] = new Intl.DateTimeFormat().formatRangeToParts(1000, 1000000000); diff --git a/tests/cases/conformance/es2023/intlNumberFormatES2023.ts b/tests/cases/conformance/es2023/intlNumberFormatES2023.ts new file mode 100644 index 0000000000000..a84b985e41cfa --- /dev/null +++ b/tests/cases/conformance/es2023/intlNumberFormatES2023.ts @@ -0,0 +1,26 @@ +// @target: es2022 +// @lib: es2022,es2023.intl +// @strict: true + +// New / updated resolved options in ES2023, including type change for useGrouping +const { roundingPriority, roundingMode, roundingIncrement, trailingZeroDisplay, useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); + +// Empty options +new Intl.NumberFormat('en-GB', {}); + +// Rounding +new Intl.NumberFormat('en-GB', { roundingPriority: 'lessPrecision', roundingIncrement: 100, roundingMode: 'trunc' }); + +// Changes to signDisplay +const { signDisplay } = new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions(); + +// Changes to useGrouping +new Intl.NumberFormat('en-GB', { useGrouping: true }); +new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); +new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); + +// formatRange +new Intl.NumberFormat('en-GB').formatRange(10, 100); +new Intl.NumberFormat('en-GB').formatRange(10n, 1000n); +new Intl.NumberFormat('en-GB').formatRangeToParts(10, 1000)[0]; +new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0]; diff --git a/tests/cases/conformance/es2023/intlNumberFormatES5UseGrouping.ts b/tests/cases/conformance/es2023/intlNumberFormatES5UseGrouping.ts new file mode 100644 index 0000000000000..d6ffd1c9395cb --- /dev/null +++ b/tests/cases/conformance/es2023/intlNumberFormatES5UseGrouping.ts @@ -0,0 +1,8 @@ +// @target: es5 +// @strict: true + +new Intl.NumberFormat('en-GB', { useGrouping: true }); +new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); // expect error +new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); // expect error + +const { useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions();