-
Notifications
You must be signed in to change notification settings - Fork 30
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
string-enum ignores comments #44
Comments
@havenchyk |
I'm noticing the same thing with function props, is the PR in place? |
I'm noticing the same thing with interfaces. The comment does not move with the property. For example, we start with this interface that has unsorted keys. interface Foo {
zoo: number;
bar: number; // I am a comment for the "bar" property
} Using the autofix it will be incorrectly formatted to this. Note that the interfaces keys are now correctly sorted but the comment did not move so it is now in the wrong spot. interface Foo {
bar: number;
zoo: number; // I am a comment for the "bar" property
} I was expecting this to happen. The interface keys are correctly sorted and the comment has moved also. interface Foo {
bar: number; // I am a comment for the "bar" property
zoo: number;
} |
yeah, unfortunately this is a deal breaker for many people |
I keep coming up against this problem for comments on Interfaces. @havenchyk did your PR go anywhere? |
I am now using the amazing eslint-plugin-perfectionist for the same purpose. It has alphabetical or natural sorting. Sorts everything; Interfaces, Objects, ect. Handles comments and more gracefully. Also very configurable to your exact needs. |
I noticed that
string-enum
rule ignores comments, so if you have comments on the right likewill become
which is wrong
Do you want to accept a PR for it?
The text was updated successfully, but these errors were encountered: