|
|
|
|
|
by tylerchurch
961 days ago
|
|
I think the main complaints are: 1. Enums are one of the few TypeScript features that isn't a type annotation that can simply be erased. Enums emit code and don't have an equivalent JS feature. 2. Const enums are unsupported by some bundlers/build tools, and so people try to use them and then got burned at build time. 3. The use cases covered by enums are often better served by union types. None of the above is necessarily fatal for the feature. Certainly people used to enums in other languages still like them. But all 3 combined and the general recommendation these days ends up being just don't use them. |
|
https://babeljs.io/blog/2021/07/26/7.15.0