-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Introduce ES2025 target & Add missing ScriptTargetFeatures #63046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 17 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
1f00226
feat: Add ES2025 target
petamoriken 7c48e79
fix: Add missing ScriptTargetFeatures
petamoriken f69d5ad
Add type for ES2025 `RegExp.escape`
petamoriken bb08b4c
Add type for ES2025 `Intl.DurationFormat`
petamoriken 82d7c65
baseline
petamoriken f9ec910
Tweak
petamoriken 2003118
typo
petamoriken 86c687a
baseline
petamoriken e86a117
remove "/en-US" from MDN URL
petamoriken 3ff5b2f
Merge branch 'main' into feat/es2025-target
petamoriken 57b8b0e
update `ScriptTarget.LatestStandard` to ES2025
petamoriken 06350b4
baseline
petamoriken 4c718cd
Merge branch 'main' into feat/es2025-target
petamoriken a684da6
Merge branch 'main' into feat/es2025-target
petamoriken c3e2e60
Merge branch 'main' into feat/es2025-target
petamoriken ff0e67c
fix: `getDefaultLibFileName`
petamoriken 29b9b1d
fix `Intl.DurationFormat` types
petamoriken 2e54cbc
format
petamoriken 27bfcca
fix `CommandLineOptionOfCustomType`
petamoriken ac2a287
Middle ground
jakebailey 2fcf0f8
Typo
jakebailey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /// <reference lib="es2024" /> | ||
| /// <reference lib="es2025.collection" /> | ||
| /// <reference lib="es2025.float16" /> | ||
| /// <reference lib="es2025.intl" /> | ||
| /// <reference lib="es2025.iterator" /> | ||
| /// <reference lib="es2025.promise" /> | ||
| /// <reference lib="es2025.regexp" /> |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| /// <reference lib="es2025" /> | ||
| /// <reference lib="dom" /> | ||
| /// <reference lib="webworker.importscripts" /> | ||
| /// <reference lib="scripthost" /> | ||
| /// <reference lib="dom.iterable" /> | ||
| /// <reference lib="dom.asynciterable" /> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not strictly required anymore (for any of the libs), but not a problem in this PR; can be cleaned up later. |
||
|
jakebailey marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,135 @@ | ||
| /// <reference lib="es2018.intl" /> | ||
|
jakebailey marked this conversation as resolved.
|
||
|
|
||
| declare namespace Intl { | ||
| /** | ||
| * An object representing the relative time format in parts | ||
| * that can be used for custom locale-aware formatting. | ||
| * | ||
| * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/formatToParts). | ||
| */ | ||
| type DurationFormatPart = | ||
| | { | ||
| type: "literal"; | ||
| value: string; | ||
| unit?: "year" | "month" | "week" | "day" | "hour" | "minute" | "second" | "milliseconds" | "microseconds" | "nanoseconds"; | ||
| } | ||
| | { | ||
| type: Exclude<NumberFormatPartTypes, "literal">; | ||
| value: string; | ||
| unit: "year" | "month" | "week" | "day" | "hour" | "minute" | "second" | "milliseconds" | "microseconds" | "nanoseconds"; | ||
| }; | ||
|
|
||
| /** | ||
| * An object with some or all properties of the `Intl.DurationFormat` constructor `options` parameter. | ||
| * | ||
| * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/DurationFormat#parameters) | ||
| */ | ||
| interface DurationFormatOptions { | ||
| localeMatcher?: "lookup" | "best fit" | undefined; | ||
| numberingSystem?: string | undefined; | ||
| style?: "long" | "short" | "narrow" | "digital" | undefined; | ||
| years?: "long" | "short" | "narrow" | undefined; | ||
| yearsDisplay?: "always" | "auto" | undefined; | ||
| months?: "long" | "short" | "narrow" | undefined; | ||
| monthsDisplay?: "always" | "auto" | undefined; | ||
| weeks?: "long" | "short" | "narrow" | undefined; | ||
| weeksDisplay?: "always" | "auto" | undefined; | ||
| days?: "long" | "short" | "narrow" | undefined; | ||
| daysDisplay?: "always" | "auto" | undefined; | ||
| hours?: "long" | "short" | "narrow" | "numeric" | "2-digit" | undefined; | ||
| hoursDisplay?: "always" | "auto" | undefined; | ||
| minutes?: "long" | "short" | "narrow" | "numeric" | "2-digit" | undefined; | ||
| minutesDisplay?: "always" | "auto" | undefined; | ||
| seconds?: "long" | "short" | "narrow" | "numeric" | "2-digit" | undefined; | ||
| secondsDisplay?: "always" | "auto" | undefined; | ||
| milliseconds?: "long" | "short" | "narrow" | "numeric" | undefined; | ||
| millisecondsDisplay?: "always" | "auto" | undefined; | ||
| microseconds?: "long" | "short" | "narrow" | "numeric" | undefined; | ||
| microsecondsDisplay?: "always" | "auto" | undefined; | ||
| nanoseconds?: "long" | "short" | "narrow" | "numeric" | undefined; | ||
| nanosecondsDisplay?: "always" | "auto" | undefined; | ||
| fractionalDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | undefined; | ||
| } | ||
|
|
||
| /** | ||
| * The Intl.DurationFormat object enables language-sensitive duration formatting. | ||
| * | ||
| * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat) | ||
| */ | ||
| interface DurationFormat { | ||
| /** | ||
| * @param duration The duration object to be formatted. It should include some or all of the following properties: months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds. | ||
| * | ||
| * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/format). | ||
| */ | ||
| format(duration: Partial<Record<"years" | "months" | "weeks" | "days" | "hours" | "minutes" | "seconds" | "milliseconds" | "microseconds" | "nanoseconds", number>>): string; | ||
| /** | ||
| * @param duration The duration object to be formatted. It should include some or all of the following properties: months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds. | ||
| * | ||
| * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/formatToParts). | ||
| */ | ||
| formatToParts(duration: Partial<Record<"years" | "months" | "weeks" | "days" | "hours" | "minutes" | "seconds" | "milliseconds" | "microseconds" | "nanoseconds", number>>): DurationFormatPart[]; | ||
| /** | ||
| * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/resolvedOptions). | ||
| */ | ||
| resolvedOptions(): ResolvedDurationFormatOptions; | ||
| } | ||
|
|
||
|
|
||
| interface ResolvedDurationFormatOptions { | ||
| locale: string; | ||
| numberingSystem: string; | ||
| style: "long" | "short" | "narrow" | "digital"; | ||
| years: "long" | "short" | "narrow"; | ||
| yearsDisplay: "always" | "auto"; | ||
| months: "long" | "short" | "narrow"; | ||
| monthsDisplay: "always" | "auto"; | ||
| weeks: "long" | "short" | "narrow"; | ||
| weeksDisplay: "always" | "auto"; | ||
| days: "long" | "short" | "narrow"; | ||
| daysDisplay: "always" | "auto"; | ||
| hours: "long" | "short" | "narrow" | "numeric" | "2-digit"; | ||
| hoursDisplay: "always" | "auto"; | ||
| minutes: "long" | "short" | "narrow" | "numeric" | "2-digit"; | ||
| minutesDisplay: "always" | "auto"; | ||
| seconds: "long" | "short" | "narrow" | "numeric" | "2-digit"; | ||
| secondsDisplay: "always" | "auto"; | ||
| milliseconds: "long" | "short" | "narrow" | "numeric"; | ||
| millisecondsDisplay: "always" | "auto"; | ||
| microseconds: "long" | "short" | "narrow" | "numeric"; | ||
| microsecondsDisplay: "always" | "auto"; | ||
| nanoseconds: "long" | "short" | "narrow" | "numeric"; | ||
| nanosecondsDisplay: "always" | "auto"; | ||
| fractionalDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; | ||
|
jakebailey marked this conversation as resolved.
|
||
| } | ||
|
|
||
| const DurationFormat: { | ||
| prototype: DurationFormat; | ||
|
|
||
| /** | ||
| * @param locales A string with a BCP 47 language tag, or an array of such strings. | ||
| * For the general form and interpretation of the `locales` argument, see the [Intl](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation) | ||
| * page. | ||
| * | ||
| * @param options An object for setting up a duration format. | ||
| * | ||
| * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/DurationFormat). | ||
| */ | ||
| new (locales?: LocalesArgument, options?: DurationFormatOptions): DurationFormat; | ||
|
|
||
| /** | ||
| * Returns an array containing those of the provided locales that are supported in display names without having to fall back to the runtime's default locale. | ||
| * | ||
| * @param locales A string with a BCP 47 language tag, or an array of such strings. | ||
| * For the general form and interpretation of the `locales` argument, see the [Intl](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation) | ||
| * page. | ||
| * | ||
| * @param options An object with a locale matcher. | ||
| * | ||
| * @returns An array of strings representing a subset of the given locale tags that are supported in display names without having to fall back to the runtime's default locale. | ||
| * | ||
| * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/supportedLocalesOf). | ||
| */ | ||
| supportedLocalesOf(locales?: LocalesArgument, options?: Pick<DurationFormatOptions, "localeMatcher">): UnicodeBCP47LocaleIdentifier[]; | ||
| }; | ||
| } | ||
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| interface RegExpConstructor { | ||
| /** | ||
| * Escapes any RegExp syntax characters in the input string, returning a | ||
| * new string that can be safely interpolated into a RegExp as a literal | ||
| * string to match. | ||
| * @example | ||
| * ```ts | ||
| * const regExp = new RegExp(RegExp.escape("foo.bar")); | ||
| * regExp.test("foo.bar"); // true | ||
| * regExp.test("foo!bar"); // false | ||
| * ``` | ||
| */ | ||
| escape(string: string): string; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,8 @@ | ||
| /// <reference lib="es2024" /> | ||
| /// <reference lib="es2025" /> | ||
| /// <reference lib="esnext.intl" /> | ||
| /// <reference lib="esnext.decorators" /> | ||
| /// <reference lib="esnext.disposable" /> | ||
| /// <reference lib="esnext.collection" /> | ||
| /// <reference lib="esnext.array" /> | ||
| /// <reference lib="esnext.iterator" /> | ||
| /// <reference lib="esnext.promise" /> | ||
| /// <reference lib="esnext.float16" /> | ||
| /// <reference lib="esnext.error" /> | ||
| /// <reference lib="esnext.sharedmemory" /> | ||
| /// <reference lib="esnext.typedarrays" /> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are none of these applicable to ES2025?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
Intlnamespace was written, and I have not touched this file.ref: https://github.com/tc39/proposals/blob/main/finished-proposals.md