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
jsx-sort-props sorts differently when using Czech language #3613
Comments
This is intentional; it's assumed everyone working on the same project is using the same locale. |
I don't think that's practical for international teams. |
The rule takes a |
Sorting shall work the same for different locales. See jsx-eslint/eslint-plugin-react#3613
@ljharb Thanks for pointing this out. I think that the default should be
If a team decides to use another locale, then that’s fine. By providing a default, you make sure that everybody gets the same sorting result. |
That would be a breaking change, so it’s unlikely to ever happen - and it would be a bit anglocentric i think? |
As properties are named in English, I guess it’s only logical to have the default |
There are plenty of codebases where that’s not the case, even though the language uses English names. Either way, we’re not doing a major bump any time soon, and the locale option i think answers your question. |
I can understand that a breaking change is not good. It was quite tedious for us to find the reason for the different sorting of the properties. |
Is there an existing issue for this?
Description Overview
When working with Windows and using the Czech language as the "Windows display language", it sorts differently.
English:
Czech:
This is because the letter "Ch" comes after the letter "D" in the Czech alphabet.
See: https://en.wikipedia.org/wiki/Czech_orthography#Alphabet
Affected rule: https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md
Expected Behavior
It should work the same in all languages because the programming language is English and not Czech.
eslint-plugin-react version
7.32.2
eslint version
v8.12.0
node version
v16.15.1
The text was updated successfully, but these errors were encountered: