-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
add autofix to sort-default-props #2062
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
Comments
I would love to help with that one. Be patient, it will be my first contribution. |
With
And
A fixer can break the code |
@VincentLanglet an incorrect fixer can break any code; a correct fixer for this rule must not move anything across the boundary created by a spread prop. |
@ljharb I agree that a correct fixer for this rule must not move anything across the boundary created by a spread prop. But then this fixer won't fix something like
And actually the expected code is
But
That's why I asked for an option to use the sort-default-props without having |
Right - the proper thing there is for the autofixer to ignore that change, leaving behind an un-auto-fixable error that you’re forced to manually address. Perhaps I’ve misunderstood tho; you want an option that does not force sorting across spread boundaries, whether autofixed or not? |
FWIW the |
In that case, this option requested in #2178 would, when enabled, just make the autofixer go from "partial" to "full". |
Adding a note here to be sure that, when implemented, it moves any associated comments (as per #1940 ) |
Add same sorting behaviour to sort-default-props as to sort-props
The text was updated successfully, but these errors were encountered: