infctr/eslint-plugin-typescript-sort-keys

Conflict to @typescript-eslint/member-ordering

neviaumi opened this issue · 8 comments

I like this plugin idea which will auto-fix the member ordering inside interface

but seem it would conflict to
member-order

because this plugin don't care the member type

E.G. given below interface

interface Demo {
   b: string
   a() : void
}

it would complain error in above interface because a is after b.

But if fix it by move a before b, member-ordering would complain method should after attribute.

Beside turn off either one, did it any suggestion can keep both running ?

Yes, seems this would require signature type aware order sorting and/or allow the rule leverage @typescript-eslint/member-ordering

Any hints on how should i did the code change ? i can help for open PR for that

Unfortunately it didn't have autofix feature :(

I see. Well interface member type signature could be extracted from the node. Then the rule should accept an array of types as options that are going to be used for sorting just the way member-ordering does so that they're fully compatible, however I assume this is going to be a huge effort

Would be nice to have this resolved, facing the same issue.

There is a way to ignore methods and only sort keys?

In the meantime, a workaround is to move all methods to a separated interface and extend it, so they are sorted separately. 😅

@infctr seems like @nelson6e65 landed on the right fix here. what's the chance of getting this fixed?