u/dimitropoulosin r/typescript • Recommends
Enums are MISUNDERSTOOD (not terrible): Josh Goldberg, typescript-eslint maintainer
#typescriptenums#typescript-eslint#tc39
22K subscribers • 12 videos on Hallway
Intermediate. Assumes working knowledge.
3.8K views3 years ago1 recommendation
Programming languagesTypeScriptLanguage design and type systems
Josh Goldberg explains the history, quirks, and benefits of TypeScript enums, including safety improvements in TypeScript 5.0 and typescript-eslint rules.
Maybe enums are just... misunderstood? But if everyone misunderstands them, is that not an indication of something bad? Much has been said about TypeScript's enums: one of the two runtime extensions from TypeScript that just won't seem to die in popular usage. They've got their quirks and some decry them as terrible - but others swear by their benefits. This talk will dive into the "what" and "why" of TypeScript's enums: why they came to be the way they are, why their quirks are really features, and what you can do to use them correctly. We'll look at upcoming changes in TypeScript 5.0 that will make them much safer to use, and some extra lint rules from typescript-eslint that fill in the gaps in the meantime. Lastly, we'll peek at the TC39 proposal to add even better enums to the JavaScript language itself - with native support for all sorts of great enum-y features. re: Aaron's Enums are Terrible talk Enums?! Justifying the Quirks TypeScript 5.0's Improvements typescript-eslint's Bandaids TC39 Enums Proposal Aaron question: does Josh use Enums banning Enums with eslint comparison to other languages were bitwise by default a mistake? Here's the slides for the talk: 1drv.ms/p/s!AvUc1cvPrJnWvtxotadetl0OqRwitA?e=LKDmo9 Discord: discord.gg/tmhGfR4Dye Twitter: twitter.com/MiTypeScript Mastodon: fosstodon.org/@MichiganTypeScript Instagram: instagram.com/michigantypescript TikTok: tiktok.com/@michigantypescriptWhat people say. Recommended for its deep dive into the history and proper usage of TypeScript enums.
u/dimitropoulosin r/typescript • Recommends
u/got_no_time_for_thatin r/typescript • Mentions
On “How to use enum as key when define interface?”