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
Fix reservedFirst
for jsx-sort-props
rule
#1883
Merged
ljharb
merged 2 commits into
jsx-eslint:master
from
fleischie:jsx-sort-props/fix-reserved-first
Jul 16, 2018
Merged
Fix reservedFirst
for jsx-sort-props
rule
#1883
ljharb
merged 2 commits into
jsx-eslint:master
from
fleischie:jsx-sort-props/fix-reserved-first
Jul 16, 2018
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add tests, that surface the incorrect behavior of the combinations `reservedFirst` and `shorthandLast` for the `jsx-sort-props` rule.
- Remove unneccessary handling of sort-checking in jsx props, as this is being handled later by the general case anyways. - Fix erroneous call to `generateFixerFunction` in general sort-checking, which was missing the `reservedList` parameter.
ljharb
approved these changes
Jul 16, 2018
This was referenced Aug 14, 2018
Merged
This was referenced Sep 22, 2018
Closed
This was referenced Oct 21, 2018
This was referenced Oct 30, 2018
This was referenced Nov 23, 2018
1 task
1 task
1 task
This was referenced Dec 21, 2018
This was referenced Dec 31, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
this PR should (hopefully) fix #1692 .
Previously if
reservedFirst
was enabled, it would customly check for the sorting of the props, if the currently viewed items were of the same type (either both reserved or both unreserved) and if not otherwise set up (i.e.noSortAlphabetically
was enabled).This PR now adds test cases for the viewed case:
reservedFirst
andshorthandLast
(I didn't add any more test cases, but can do so, if requested). Also it removes the special handling of the sorting but delegates to the rest of the handler to take care of any other options (e.g.shorthandLast
,shorthandFirst
,callbackLast
, etc.). (Also there was a missing parameter in the shadowed alphabetically-sorting check, which I added).Yeah. If you need/require anything else from this PR, hit me up and I'll add it. Additionally I hope it's ok, when I regularly rebase this onto master, if any other development is done (if not, let me know as well). 😄