-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
fix(40806): Add missing options and possible values of DateTimeFormat #41880
fix(40806): Add missing options and possible values of DateTimeFormat #41880
Conversation
It looks like you've sent a pull request to update our 'lib' files. These files aren't meant to be edited by hand, as they consist of last-known good states of the compiler and are generated from 'src'. Unless this is necessary, consider closing the pull request and sending a separate PR to update 'src'. |
581b896
to
afe9619
Compare
afe9619
to
5790472
Compare
Alright, this looks good to me - thanks 👍🏻 |
I am seeing some problems compiling TypeScript code with this change. I believe the issue is that the types in // ES5:
interface DateTimeFormatOptions {
localeMatcher?: string;
weekday?: string;
era?: string;
year?: string;
month?: string;
day?: string;
hour?: string;
minute?: string;
second?: string;
timeZoneName?: string;
formatMatcher?: string;
hour12?: boolean;
timeZone?: string;
}
// ES2020:
interface DateTimeFormatOptions {
dateStyle?: "full" | "long" | "medium" | "short";
timeStyle?: "full" | "long" | "medium" | "short";
calendar?: "buddhist" | "chinese" | " coptic" | "ethiopia" | "ethiopic" | "gregory" | " hebrew" | "indian" | "islamic" | "iso8601" | " japanese" | "persian" | "roc";
dayPeriod?: "narrow" | "short" | " long";
numberingSystem?: "arab" | "arabext" | " bali" | "beng" | "deva" | "fullwide" | " gujr" | "guru" | "hanidec" | "khmr" | " knda" | "laoo" | "latn" | "limb" | "mlym" | " mong" | "mymr" | "orya" | "tamldec" | " telu" | "thai" | "tibt";
localeMatcher?: "best fit" | "lookup";
timeZone?: string;
hour12?: boolean;
hourCycle?: "h11" | "h12" | "h23" | "h24";
formatMatcher?: "best fit" | "basic";
weekday?: "long" | "short" | "narrow";
era?: "long" | "short" | "narrow";
year?: "numeric" | "2-digit";
month?: "numeric" | "2-digit" | "long" | "short" | "narrow";
day?: "numeric" | "2-digit";
hour?: "numeric" | "2-digit";
minute?: "numeric" | "2-digit";
second?: "numeric" | "2-digit";
fractionalSecondDigits?: 0 | 1 | 2 | 3;
timeZoneName?: "long" | "short";
} Fields like
Also, several of the property values have leading spaces, e.g. |
In Typescript 4.2 type definitions for Intl API was updated (microsoft/TypeScript#41880). Because of that we now have compile error when we try to compile vue-i18n in TS 4.2 RC. The reason is our wrong type definition for "localeMatcher" and "formatMatcher" properties. We had "best-fit" but it should be "best fit". This was the error when we compile vue-i18n with Typescript 4.2 RC. Now it's fixed.: > npx [email protected] -p types npx: installed 1 in 3.512s types/index.d.ts:26:13 - error TS2430: Interface 'SpecificDateTimeFormatOptions' incorrectly extends interface 'DateTimeFormatOptions'. Types of property 'localeMatcher' are incompatible. Type 'LocaleMatcher | undefined' is not assignable to type '"best fit" | "lookup" | undefined'. Type '"best-fit"' is not assignable to type '"best fit" | "lookup" | undefined'. 26 interface SpecificDateTimeFormatOptions extends Intl.DateTimeFormatOptions { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Found 1 error.
In Typescript 4.2 type definitions for Intl API was updated (microsoft/TypeScript#41880). Because of that we now have compile error when we try to compile vue-i18n in TS 4.2 RC. The reason is our wrong type definition for "localeMatcher" and "formatMatcher" properties. We had "best-fit" but it should be "best fit". This was the error when we compile vue-i18n with Typescript 4.2 RC. Now it's fixed.: > npx [email protected] -p types npx: installed 1 in 3.512s types/index.d.ts:26:13 - error TS2430: Interface 'SpecificDateTimeFormatOptions' incorrectly extends interface 'DateTimeFormatOptions'. Types of property 'localeMatcher' are incompatible. Type 'LocaleMatcher | undefined' is not assignable to type '"best fit" | "lookup" | undefined'. Type '"best-fit"' is not assignable to type '"best fit" | "lookup" | undefined'. 26 interface SpecificDateTimeFormatOptions extends Intl.DateTimeFormatOptions { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Found 1 error. Co-authored-by: Mariusz Pawelski <[email protected]>
In Typescript 4.2 type definitions for Intl API was updated (microsoft/TypeScript#41880). Because of that we now have compile error when we try to compile vue-i18n in TS 4.2 RC. The reason is our wrong type definition for "localeMatcher" and "formatMatcher" properties. We had "best-fit" but it should be "best fit". This was the error when we compile vue-i18n with Typescript 4.2 RC. Now it's fixed.: > npx [email protected] -p types npx: installed 1 in 3.512s types/index.d.ts:26:13 - error TS2430: Interface 'SpecificDateTimeFormatOptions' incorrectly extends interface 'DateTimeFormatOptions'. Types of property 'localeMatcher' are incompatible. Type 'LocaleMatcher | undefined' is not assignable to type '"best fit" | "lookup" | undefined'. Type '"best-fit"' is not assignable to type '"best fit" | "lookup" | undefined'. 26 interface SpecificDateTimeFormatOptions extends Intl.DateTimeFormatOptions { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Found 1 error. Co-authored-by: Mariusz Pawelski <[email protected]>
In Typescript 4.2 type definitions for Intl API was updated (microsoft/TypeScript#41880). Because of that we now have compile error when we try to compile vue-i18n in TS 4.2 RC. The reason is our wrong type definition for "localeMatcher" and "formatMatcher" properties. We had "best-fit" but it should be "best fit". This was the error when we compile vue-i18n with Typescript 4.2 RC. Now it's fixed.: > npx [email protected] -p types npx: installed 1 in 3.512s types/index.d.ts:26:13 - error TS2430: Interface 'SpecificDateTimeFormatOptions' incorrectly extends interface 'DateTimeFormatOptions'. Types of property 'localeMatcher' are incompatible. Type 'LocaleMatcher | undefined' is not assignable to type '"best fit" | "lookup" | undefined'. Type '"best-fit"' is not assignable to type '"best fit" | "lookup" | undefined'. 26 interface SpecificDateTimeFormatOptions extends Intl.DateTimeFormatOptions { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Found 1 error. Co-authored-by: Mariusz Pawelski <[email protected]>
In Typescript 4.2 type definitions for Intl API was updated (microsoft/TypeScript#41880). Because of that we now have compile error when we try to compile vue-i18n in TS 4.2 RC. The reason is our wrong type definition for "localeMatcher" and "formatMatcher" properties. We had "best-fit" but it should be "best fit". This was the error when we compile vue-i18n with Typescript 4.2 RC. Now it's fixed.: > npx [email protected] -p types npx: installed 1 in 3.512s types/index.d.ts:26:13 - error TS2430: Interface 'SpecificDateTimeFormatOptions' incorrectly extends interface 'DateTimeFormatOptions'. Types of property 'localeMatcher' are incompatible. Type 'LocaleMatcher | undefined' is not assignable to type '"best fit" | "lookup" | undefined'. Type '"best-fit"' is not assignable to type '"best fit" | "lookup" | undefined'. 26 interface SpecificDateTimeFormatOptions extends Intl.DateTimeFormatOptions { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Found 1 error. Co-authored-by: Mariusz Pawelski <[email protected]>
Fixes #40806
Options of Intl DateTimeFormat and possible values taken from MDN page Intl/DateTimeFormat.