TypeScript 5.8 Bids Farewell to Enums: A Dignified Exit

2025-03-02
TypeScript 5.8 Bids Farewell to Enums: A Dignified Exit

TypeScript 5.8 introduces the `--erasableSyntaxOnly` flag, effectively ending the era of enums and namespaces. While literal unions offer superior ergonomics, the author expresses nostalgia for enums. The article highlights a key advantage of enums: superior documentation support for members, including deprecation notices, crucial in large codebases, a feature lacking in literal unions. The author urges the TypeScript team to improve documentation support for literal unions in future releases.

Development enums literal unions