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

jsx-sort-props noSortAlphabetically option #979

Merged

Conversation

markus101
Copy link
Contributor

Adds a noSortAlphabetically option to jsx-sort-props which will allow sorting of callbacks last without forcing alphabetical ordering.

Closes #541
Closes #786

@markus101
Copy link
Contributor Author

Not sure if anyone has taken a look at this yet, it'd be great to get this added if it's acceptable. If I should make any changes, please anything let me know.

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

Seems legit

@@ -114,7 +119,7 @@ module.exports = {
}
}

if (currentPropName < previousPropName) {
if (!noSortAlphabetically && currentPropName < previousPropName) {
Copy link
Member

Choose a reason for hiding this comment

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

This should be using localeCompare, not <, but that's out of scope for this PR

@lencioni lencioni merged commit c62dccf into jsx-eslint:master Jan 29, 2017
christophehurpeau added a commit to christophehurpeau/eslint-plugin-react that referenced this pull request Jul 23, 2018
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.

3 participants