News for hackers. Stuff that matters.
Re:TypeScript enums: use cases and alternatives by WorldMaker on Monday January 20, 2025 @11:59AM (#42770586)
Those flags have already started to show up in today's typescript: verbatimModuleSyntax [1] and isolatedModules [2], for instance.

[1] https://www.typescriptlang.org/tsconfig/#verbatimModuleSynta...

[2] https://www.typescriptlang.org/tsconfig/#isolatedModules

Re:TypeScript enums: use cases and alternatives by throwitaway1123 on Monday January 20, 2025 @12:11PM (#42770726)
Those definitely help, but the proposed erasableSyntaxOnly flag would disallow all features that can't be erased. So it would prevent you from using features like class parameter properties [1], enums, namespaces, and I'm assuming experimental decorators also.

It would essentially help you produce TypeScript that's compatible with the --experimental-strip-types flag (and ts-blank-space), rather than the --experimental-transform-types flag, which is nice because (as someone else in this thread pointed out), Node 23 enables the --experimental-strip-types flag by default: https://nodejs.org/en/blog/release/v23.6.0#unflagging---expe...

[1] https://www.typescriptlang.org/docs/handbook/2/classes.html#...

Re:TypeScript enums: use cases and alternatives by WorldMaker on Monday January 20, 2025 @12:35PM (#42771010)
Also worth noting that the eslint rules for what `erasableSyntaxOnly` might be are already well established, for those looking to do it today.