-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript enums not sorted #1820
Comments
Hmmm interesting request which could work in some cases. The main case for enum is that you don't define anything:
in which case they are in order since We could technically sort keys with assigned values as long as they are adjacent:
As they wouldn't impact the inferred value provided to keys without values. This would resolve your ticket. But to respond to your statement "It seems like sortier ignores the Typescript enums. It should be sorting them by keys." the answer is yes because without values, the order of an enum is crucial to it's generated value hence why it was ignored. However you bring up a good point that if the values are defined, we should be able to change the order. Let me think on this to see if there are scenarios I'm missing. |
I'd welcome a PR here, should be relatively straight forward:
|
Language
Typescript
Sample input source code
Expected output
Actual output
It seems like sortier ignores the Typescript enums. It should be sorting them by keys.
The text was updated successfully, but these errors were encountered: