Open havenchyk opened 2 years ago
@havenchyk Will appreciate a PR
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?