-
Notifications
You must be signed in to change notification settings - Fork 37
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
feat(multiple rules): Do not sort unknown elements if unknown is not referenced in groups #271
Open
hugop95
wants to merge
19
commits into
azat-io:main
Choose a base branch
from
hugop95:feat/no-unknown-sort
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
hugop95
force-pushed
the
feat/no-unknown-sort
branch
3 times, most recently
from
September 14, 2024 12:50
c75beb7
to
92972d3
Compare
hugop95
force-pushed
the
feat/no-unknown-sort
branch
from
September 15, 2024 21:21
3188117
to
5d59c34
Compare
Could you fix merge conflicts? |
hugop95
force-pushed
the
feat/no-unknown-sort
branch
from
September 19, 2024 20:11
5d59c34
to
74dcebd
Compare
@azat-io Done! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
The large majority of the actual code added involves documentation and tests.
Extends #220 to other rules that handle the
unknown
group.When the
unknown
group is not entered by the user in thegroups
option,unknown
group members will not be sorted and will remain where they are rather than go at the very bottom.sort-astro-attributes
sort-interfaces
sort-intersection-types
sort-jsx-props
sort-object-types
sort-objects
sort-svelte-attributes
sort-union-types
sort-vue-attributes
The
sort-imports
rule takes into account other complex elements such as newline separation, making it very different than other rules. Left for another PR if needed.Rules that had a default group configuration equal to
[]
now have['unknown']
(otherwise, they would not sort anything by default).Because all those rules rely on the same code to sort groups, a
sortNodesByGroups
function has been extracted, greatly reducing the amount of duplicate code.No existing unit test was impacted.
What is the purpose of this pull request?