Skip to content

Conversation

lencioni
Copy link
Contributor

The Airbnb JavaScript style guide was recently updated to sort static
methods to the tops of classes 0. Since this codemod is designed to
follow the constraints of the Airbnb style guide, I figured it would be
good to update this as well.

The Airbnb JavaScript style guide was recently updated to sort static
methods to the tops of classes [0]. Since this codemod is designed to
follow the constraints of the Airbnb style guide, I figured it would be
good to update this as well.

[0]: airbnb/javascript#715
cpojer added a commit that referenced this pull request Feb 26, 2016
Teach sort-comp to put static methods at the top
@cpojer cpojer merged commit 323ef72 into reactjs:master Feb 26, 2016
@cpojer
Copy link
Member

cpojer commented Feb 26, 2016

thank you!

} else {
matching = methodsOrder[i] === method;
// Check for static methods
if (indexes.length === 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indexes.length has to equal zero at this point. it just initialized to empty array in the line above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. I decided to add the check here to make it so we don't have to change this again if we add something before it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. What do you think of #32?

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

Successfully merging this pull request may close these issues.

3 participants