-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
react/jsx-sort-props not working #1320
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
There must be something else going on - the test cases (https://github.com/yannickcr/eslint-plugin-react/blob/master/tests/lib/rules/jsx-sort-props.js#L106, https://github.com/yannickcr/eslint-plugin-react/blob/master/tests/lib/rules/jsx-sort-props.js#L162) seem pretty solid. Can you provide a full repro case, not just with options omitted? |
https://github.com/tobyf93/jsx-sort-props-issue
|
same result for:
|
I just run into this issue too. I think that when Adding a test case like this shows the issue: {
code: '<App key={2} b a />',
options: reservedFirstAsBooleanArgs,
errors: [expectedError]
} I don't know if the expected behavior is that sorting is only enforced within the reserved props, but I would expect the alphabetical order to also be enforced in the other props. I think I have a fix for this, so I'm gonna submit a PR with it. If this fix is not desired and current behavior is the desired, I apologize for all this noise. |
Still not working any working fix? |
I seem to be having trouble getting this rule to work. The documentation references the following interface:
My current configuration is
"react/jsx-sort-props": [2]
. I have omitted the options which seem to work fine for other rules in the library. Don't get any errors for the following component:The text was updated successfully, but these errors were encountered: