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

react/jsx-sort-props gets confused when props are sorted with --fix but one has camelCase #2381

Closed
Marpfie opened this issue Aug 14, 2019 · 0 comments · Fixed by #2391 or #2556
Closed

Comments

@Marpfie
Copy link

Marpfie commented Aug 14, 2019

I found this weird issue where props were sorted automatically via the --fix option but the last one had a camel case.
The linter would then complain about the camel cased prop being expected before the other.

Example:

<Test aa aB />

image

The configuration for this was

'react/jsx-sort-props': [
            'error',
            {
                callbacksLast: true,
                reservedFirst: true,
                shorthandFirst: true,
            },
        ],

Adding the flag ignoreCase: true removed the error, but obviously that still means there is a bug somewhere.

@Marpfie Marpfie changed the title react/jsx-sort-props gets confused when props are sorted properly but one has upperCase react/jsx-sort-props gets confused when props are sorted with --fix but one has upperCase Aug 14, 2019
@Marpfie Marpfie changed the title react/jsx-sort-props gets confused when props are sorted with --fix but one has upperCase react/jsx-sort-props gets confused when props are sorted with --fix but one has camelCase Aug 14, 2019
@ljharb ljharb closed this as completed in 398b7d7 Aug 31, 2019
ljharb added a commit to tanmoyopenroot/eslint-plugin-react that referenced this issue May 12, 2020
Fixes jsx-eslint#2381. Fixes jsx-eslint#2530.

Co-authored-by: tanmoyopenroot <tanmoy.openroot@gmail.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
ljharb added a commit to tanmoyopenroot/eslint-plugin-react that referenced this issue May 12, 2020
Fixes jsx-eslint#2381. Fixes jsx-eslint#2530.

Co-authored-by: tanmoyopenroot <tanmoy.openroot@gmail.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment