-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
sort-comp: 'instance-variables' doesn't work properly #1664
Comments
Did you specify an ordering? The default ordering doesn’t include instance methods or instance variables. |
no i did not specify any custom ordering. I'd expect that the sorting order of custom properties is at least ignored (if not enforced to the top) by default |
Anything that's not explicitly specified is grouped under "everything-else", per the docs. |
Yes, I understood that. But it is a weird default that instance properties should be placed somewhere in the middle of the class body |
They’re not yet part of the language, and when the rule was created, they didn’t exist yet :-) |
well, then it should be changed now that they exist? |
That would be a breaking change; next time we do one, we can change that default. For now, you’ll need to manually specify your ordering. |
alright! Thanks for the feedback! |
These should really go at the top without generating an eslint error, they shouldn't be bundled into "everything else" They are stage 3 and not experimental https://github.com/tc39/proposal-class-fields |
Stage 3 is still experimental; only stage 4 is final. Again, you can add this category yourself to your own config - and in the next major, it’ll be a default. |
Hi @ljharb! Is it possible to make Here is our rule config
but it seems like |
Somehow everything works fine, when I run |
@serhiipalash that implies that sublime isn't using your local eslint - if you have a global one installed, try removing it. |
@ljharb actually the problem was with |
When enabling sort-comp
"react/sort-comp": 1
with[email protected]
i would expect that instance properties should be placed at the beginning of the class definition.
But with code like
i get the following warning:
ref: #1587
The text was updated successfully, but these errors were encountered: