Рет қаралды 425
With exactOptionalPropertyTypes enabled, TypeScript applies stricter rules around how it handles properties on type or interfaces which have a ? prefix. Read more here: www.typescript....
Daniel Rosenwasser (a TypeScript team member on this call) once said (github.com/mic... "If we were to start TypeScript over again, we believe the behavior of strictOptionalProperties would be on by default; however, this strictness option comes at a time when the community is much more mature with lots of existing code."
I'll leave it to you to decide, but here at Michigan TypeScript we're big fans of this flag and consider it absolutely essential if you're shipping a mature TypeScript library.
This video was part of a little mini-series discussing a few different topics with Ryan and Daniel. You can watch a playlist of the whole discussion ( • how safe is "safe enou... ) or you can pick an individual video:
- how safe is "safe enough" for TypeScript [part 1] - • how safe is "safe enou...
- Flow and TypeScript actually have the same soundness goal (!!) [part 2] - • Flow and TypeScript ac...
- how the TypeScript team factors in power users [part 3] - • how the TypeScript tea...
- TypeScript team members' reaction to ts-reset - [part 4] • TypeScript team member...
- why `exactOptionalPropertyTypes` isn't in strict-mode [part 5] - • why `exactOptionalProp...
- replacing any with unknown everywhere - the story of the failed strictAny flag [part 6] - • replacing `any` with `...
- what will TypeScript be like in the distant future? [part 7] - • TypeScript in the dist...
MiTS Discord: discord.michig...
Twitter: / mitypescript
Mastodon: fosstodon.org/...
Threads: www.threads.ne...
Instagram: / michigantypescript
TikTok: / michigantypescript