vidstack / player

UI components and hooks for building video/audio players on the web. Robust, customizable, and accessible. Modern alternative to JW Player and Video.js.
https://vidstack.io
MIT License
1.89k stars 114 forks source link

Consider enabling exactOptionalPropertyTypes in tsconfig.json #1297

Closed dodomorandi closed 1 week ago

dodomorandi commented 1 month ago

Describe:

Currently if a project enables the option exactOptionalPropertyTypes and uses vidstack, it has a lot of problems forwarding optional fields and attributes because these are just defined as field?: Type instead of field?: Type | undefined. Maybe not all cases should not have this behavior, but explicitly enabling this option would improve type safety for both internal code and users.

Alternatives:

Leave exactOptionalPropertyTypes as default/false like today, maybe document that the project does not support this Typescript feature (at least a potential user knows in advance if the library can be used).

Anything Else?

Link to the official documentation