Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Intl types: Better typing for exactOptionalPropertyTypes needed #45652

Copy link
Copy link
@HolgerJeromin

Description

@HolgerJeromin
Issue body actions

Bug Report

I did not find a "planning" issue for related issues.
All delivered types should be safe to use with the new Typescript option.

🕗 Version & Regression Information

  • I was unable to test this on prior versions because this is a new option

⏯ Playground Link

// @exactOptionalPropertyTypes
const IntlOptions: Intl.DateTimeFormatOptions = {
    timeZone: undefined
};

Workbench Repro

🙁 Actual behavior

Type 'undefined' is not assignable to type 'string'.(2322)

🙂 Expected behavior

Should compile because undefined is a valid property for that object.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat

copied from microsoft/TypeScript-DOM-lib-generator#1126

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

Domain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScript

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.