-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(eslint-plugin): [sort-type-constituents] support case sensitive sorting #8760
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
Merged
JoshuaKGoldberg
merged 18 commits into
typescript-eslint:main
from
up201304504:feature/4602-support-case-sensitive-sorting
May 16, 2024
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
f489bd6
Adding caseSensitiveSorting option
jsfm01 1d2562c
fix snapshot sort-type-constituents.shot
up201304504 fbd438f
Add tests and fix lint.
jsfm01 5e89536
add examples of the use of case-sensitive sorting web page
up201304504 0a2b5c2
Merge branch 'main' into feature/4602-support-case-sensitive-sorting
up201304504 96ffc92
Add tests
jsfm01 5cb3848
Fix test
jsfm01 0543689
Merge branch 'main' into feature/4602-support-case-sensitive-sorting
jsfm01 ed54004
Changing Naming
jsfm01 c155671
Add more tests
jsfm01 285e0ae
Merge branch 'feature/4602-support-case-sensitive-sorting' of https:/…
jsfm01 9f67a53
Merge branch 'main' into feature/4602-support-case-sensitive-sorting
jsfm01 ed8884b
Merge branch 'main' into feature/4602-support-case-sensitive-sorting
jsfm01 7bea7e4
update snapshot
up201304504 aec1448
Merge branch 'main' into feature/4602-support-case-sensitive-sorting
jsfm01 73d7db9
Merge branch 'main' into feature/4602-support-case-sensitive-sorting
jsfm01 ba019c5
Update packages/eslint-plugin/docs/rules/sort-type-constituents.mdx
jsfm01 7c3e4b6
Merge branch 'main' into feature/4602-support-case-sensitive-sorting
jsfm01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
27 changes: 22 additions & 5 deletions
27
packages/eslint-plugin/tests/docs-eslint-output-snapshots/sort-type-constituents.shot
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
6 changes: 6 additions & 0 deletions
6
packages/eslint-plugin/tests/schema-snapshots/sort-type-constituents.shot
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Non-actionable] I tried switching this to
'accent'
,'case'
, and'variant'
instead of the manualcaseSensitiveSort
function. Nothing passed all the tests. 🤷There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the sensitive case is true, it follows the Unicode code points, no matter the collator sensitivity. If the collator sensitivity is set to 'case', for instance, the sorting would still be case-sensitive, but diacritics and accents would be treated as insignificant. The “accent”, doesn’t distinguish the capital letters, for instance, a = A. I believe we should keep as ‘base’.