-
Notifications
You must be signed in to change notification settings - Fork 45
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: allows users to enter { newlinesBetween }
in groups
#435
Draft
hugop95
wants to merge
13
commits into
azat-io:main
Choose a base branch
from
hugop95:feat/newlines-between-groups
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/newlines-between-groups
branch
from
December 26, 2024 00:12
0cfa6ab
to
b720a00
Compare
hugop95
changed the title
refactor: renames props interface
feat: allows users to override Dec 26, 2024
newlinesBetween
in groups
hugop95
changed the title
feat: allows users to override
feat: allows users to enter Dec 26, 2024
newlinesBetween
in groups
{ newlinesBetween }
in groups
hugop95
force-pushed
the
feat/newlines-between-groups
branch
from
December 26, 2024 15:59
b720a00
to
322d514
Compare
…ways' | 'never' }` in `groups`
hugop95
force-pushed
the
feat/newlines-between-groups
branch
from
December 26, 2024 16:19
322d514
to
d561f91
Compare
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.
Resolves #401
Continuation of #428.
customGroup.newlinesInside
option. We will take the opportunity to create agetNewlinesBetweenOption
method that will help us later to precisely customize newline behavior between two specific groups.Description
Allows users to enter
{ newlinesBetween: 'always' | 'never' | 'ignore' }
between elements of thegroups
option. This enables precisely setting/overriding the newline behavior between two groups.Example:
{ newlinesBetween: 'ignore' }
is only useful if anewlinesBetween
option different fromignore
is set.{ newlinesBetween }
objects in a group configuration will raise an error:Consecutive 'newlinesBetween' objects are not allowed
.Impacted rules
sort-imports
sort-intersection-types
sort-union-types
sort-classes
sort-modules
sort-object-types
Additional notes
❓ Is this better than proposal 1 ?
Proposal 1:
You can see a proof of concept PR here.
I believe the current implementation is superior:
newlinesAbove
incompatible with thenewlinesUnder
of the above group.groups
.❓ Why not use string tokens instead of an object, such as
"newlinesBetween:always"
?I believe that an object gives us more flexibility in the future if we want to allow users to pass additional options.
It's also easy to distinguish those objects from the group names.
What is the purpose of this pull request?