Skip to content
0:00 / 0:00

#typescriptenums#typescript-eslint#tc39

Enums are MISUNDERSTOOD (not terrible): Josh Goldberg, typescript-eslint maintainer

Michigan TypeScript

22K subscribers • 12 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Presented by Josh Goldberg, typescript-eslint maintainer
  • An opinion. It argues one side of a question engineers disagree on.

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/@michigantypescript

Why it's here

1 person recommends this

What people say. Recommended for its deep dive into the history and proper usage of TypeScript enums.

u/dimitropoulosin r/typescript • Recommends

Enums are MISUNDERSTOOD (not terrible): Josh Goldberg, typescript-eslint maintainer

u/got_no_time_for_thatin r/typescript • Mentions

On “How to use enum as key when define interface?”

Think your link is broken: TypeScript is TERRIBLE Title is also a huge exaggeration Here's an alternative perspective, from the same meetup: ENUMS are MISUNDERSTOOD