Skip to content
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

Conflict to @typescript-eslint/member-ordering #30

Open
neviaumi opened this issue Apr 25, 2021 · 8 comments
Open

Conflict to @typescript-eslint/member-ordering #30

neviaumi opened this issue Apr 25, 2021 · 8 comments

Comments

@neviaumi
Copy link

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 ?

@infctr
Copy link
Owner

infctr commented Apr 26, 2021

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

@davidnghk01
Copy link

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

@davidnghk01
Copy link

Unfortunately it didn't have autofix feature :(

@infctr
Copy link
Owner

infctr commented Apr 26, 2021

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

@manojdcoder
Copy link

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

@nelson6e65
Copy link

nelson6e65 commented Jun 1, 2022

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. 😅

@shellscape
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants