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

Make jsx-sort-default-props fixable #2429

Merged
merged 1 commit into from Oct 4, 2019

Conversation

@emroussel
Copy link
Contributor

commented Oct 2, 2019

There didn't seem to be a reason for not fixing jsx-sort-default-props automatically.

Most of this code is copy and pasted from sort-prop-types. It might be good to abstract it somewhere so that it's not duplicated, but I wasn't sure where that should be. If you agree, feel free to point me to where these type of reusable functions usually live, and I'll move them there.

Should fix #2347.

@ljharb

This comment has been minimized.

Copy link
Collaborator

commented Oct 2, 2019

Thanks, this is great! https://github.com/yannickcr/eslint-plugin-react/tree/master/lib/util seems like a good place to put it.

@emroussel emroussel force-pushed the emroussel:fixable-jsx-sort-default-props branch from 4801abe to 70ecfd0 Oct 3, 2019
@emroussel

This comment has been minimized.

Copy link
Contributor Author

commented Oct 3, 2019

@ljharb done 👍

lib/util/propTypesSort.js Show resolved Hide resolved
lib/util/propTypesSort.js Outdated Show resolved Hide resolved
@ljharb
ljharb approved these changes Oct 4, 2019
@ljharb ljharb force-pushed the emroussel:fixable-jsx-sort-default-props branch from 90c325e to 6011505 Oct 4, 2019
@ljharb ljharb merged commit 6011505 into yannickcr:master Oct 4, 2019
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.01%) to 97.545%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.