Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upRequire JSX props to be alphabetically sorted (react/jsx-sort-props) and Require defaultProps declarations to be alphabetically sorted (react/jsx-sort-default-props) #1362
Comments
feross
added
enhancement
ecosystem impact
labels
Aug 15, 2019
feross
added this to the standard 15 milestone
Aug 15, 2019
feross
changed the title
Require JSX props to be alphabetically sorted (react/jsx-sort-props)
Require JSX props to be alphabetically sorted (react/jsx-sort-props) and Require defaultProps declarations to be alphabetically sorted (react/jsx-sort-default-props)
Aug 15, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
feross commentedAug 15, 2019
•
edited
Some developers prefer to sort props names alphabetically to be able to find necessary props easier at the later time.
https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md
This is the config I tested with and the results were reasonable:
Here's an example of a diff that applies this rule with the config from above: feross/bitmidi.com@a256ba3
And there's another related rule:
Some developers prefer to sort defaultProps declarations alphabetically to be able to find necessary declarations easier at a later time.
https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-default-props.md
Here's the config I tested with:
Feedback on these two rules very much welcome.