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

Teach sort-comp rule about static class methods #429

Merged
merged 3 commits into from
Feb 14, 2016

Conversation

lencioni
Copy link
Collaborator

@lencioni lencioni commented Feb 5, 2016

A number of people have said that they think it makes sense for static
class methods to appear at the very top of classes. This PR allows
this to be configured by adding the static-methods keyword to the
sort-comp rule.

While I was at it, I fixed a couple of typos and made a minor perf tweak.

Fixes #128

A number of people have said that they think it makes sense for static
class methods to appear at the very top of classes. This commit allows
this to be configured by adding the `static-methods` keyword to the
sort-comp rule.

Fixes jsx-eslint#128
I noticed a couple of cases where we continue looping even though we
don't need to anymore. In these special keyword cases, we can break out
of these loops as soon as we find a match to get a little bit of a speed
boost.
@ljharb
Copy link
Member

ljharb commented Feb 5, 2016

Awesome! 👍

@adrienbrault
Copy link

Can this include static properties too ?

@ljharb
Copy link
Member

ljharb commented Feb 6, 2016

Those don't exist yet. However, it should once they do :-)

@yannickcr
Copy link
Member

Thank you very much for this. But since it can be a breaking change in some configuration I will wait for the next major release to merge it.

@lencioni
Copy link
Collaborator Author

lencioni commented Feb 8, 2016

Sounds good. Is there anything I can do to help get the next major release out sooner?

@yannickcr
Copy link
Member

Sure. I will publish a checklist (maybe tomorrow) of what I would like to pass in next major release.

@yannickcr yannickcr mentioned this pull request Feb 9, 2016
7 tasks
yannickcr added a commit that referenced this pull request Feb 14, 2016
Add static method support to sort-comp (fixes #128)
@yannickcr yannickcr merged commit 003eed4 into jsx-eslint:master Feb 14, 2016
@yannickcr
Copy link
Member

Merged, thanks!

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

Successfully merging this pull request may close these issues.

sort-comp: statics out of lifecycle?
4 participants