Maybe argue for enum being added to ecmascript instead?
const MyEnum = {
x: 1,
y: 2,
z: 3,
// etc
}
instead of enum MyEnum {
x = 1,
y,
z,
// etc
}
when you want a series of constants each with a unique value but don't particularly care what that value is.TypeScript's enums are particularly weak compared to enums in other languages precisely because there's no JS support for enums. Modern languages have support for ADTs.
In the vast majority of cases, there's no good reason to do that.
Edit: But no, the reason enums in TypeScript suck is not that JS doesn't have them. That wouldn't fix anything other than the type stripping problem. The main reason that they suck is that they use a completely different type model from the rest of the language.
90% of the enums I use are regular integer enums. I don't get much use out of string enums, as you say union types do that job just fine.