-
Notifications
You must be signed in to change notification settings - Fork 453
Closed
Labels
Description
Summary
document.startViewTransition
is typed as always present, even though it is not available on Firefox
Expected vs. Actual Behavior
document.startViewTransition
should be typed function | undefined
. Currently just typed function
.
This means that using this safety check like if (!document.startViewTransition) return
results in triggering TSLints @typescript-eslint/no-unnecessary-condition
But startViewTransition isn't available on Firefox, so the check is needed.
To improve this, I highly recommend that typed use baseline status in determining what a type should be. if an API is not Baseline Wildly Available, it should probably be typed as possibly undefined
Playground Link
No response
Browser Support
- This API is supported in at least two major browser engines (not two Chromium-based browsers).
Have Tried The Latest Releases
- This issue applies to the latest release of TypeScript.
- This issue applies to the latest release of
@types/web
.
Additional Context
No response