-
Notifications
You must be signed in to change notification settings - Fork 44
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
fix: fixes overlapping errors between newlinesBetween
and comment-after
fixes
#441
Merged
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
2 tasks
hugop95
force-pushed
the
fix/overlapping-errors
branch
3 times, most recently
from
January 10, 2025 07:59
9c9e0ea
to
96ae400
Compare
hugop95
changed the title
fix: fixes overlapping errors due to
fix: fixes overlapping errors between to Jan 10, 2025
newlinesBetween
newlinesBetween
and order-related fixes
hugop95
changed the title
fix: fixes overlapping errors between to
fix: fixes overlapping errors between Jan 10, 2025
newlinesBetween
and order-related fixesnewlinesBetween
and order-related fixes
hugop95
force-pushed
the
fix/overlapping-errors
branch
from
January 10, 2025 12:26
96ae400
to
de37084
Compare
hugop95
force-pushed
the
fix/overlapping-errors
branch
4 times, most recently
from
January 10, 2025 18:08
b162c04
to
b7a3812
Compare
hugop95
changed the title
fix: fixes overlapping errors between
fix: fixes overlapping errors between Jan 10, 2025
newlinesBetween
and order-related fixesnewlinesBetween
and comment-after
fixes
hugop95
force-pushed
the
fix/overlapping-errors
branch
from
January 12, 2025 09:37
b7a3812
to
5200b6d
Compare
hugop95
force-pushed
the
fix/overlapping-errors
branch
from
January 12, 2025 09:48
5200b6d
to
c8b06e7
Compare
Looks good. I am a bit confused by the long function names. And I want to take some time to think if it can be made a bit simpler. |
azat-io
reviewed
Jan 12, 2025
rules/sort-array-includes.ts
Outdated
@@ -39,6 +38,7 @@ import { createEslintRule } from '../utils/create-eslint-rule' | |||
import { getLinesBetween } from '../utils/get-lines-between' | |||
import { getGroupNumber } from '../utils/get-group-number' | |||
import { getSourceCode } from '../utils/get-source-code' | |||
import { makeAllFixes } from '../utils/make-all-fixes' |
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.
Why not makeFixes
?
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.
azat-io
approved these changes
Jan 13, 2025
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.
Related issue: #11
Related comment: #11 (comment)
Description
Note: good news! I've managed to find a way to fix this without impacting any existing test 🙂
In some specific cases, comments-related fixes and newline fixes may overlap.
Example
Today, both comment/order fixes and newlines fixes are done in the same cycle. The easiest fix is to separate those fixes into a different cycle (see below).
Proposal
The PR includes a refactor part and a simple fix that aims to separate the "comments after" fixes and the newlines fixes. "comments after" fixes are fixes related to comments appearing at the end of lines, after nodes.
State today
makeFixes
handles:makeNewlinesFixes
handles only newline fixes.Commits split
The refactor commits (first 5 commits) rename and split existing functions into new functions in order to separate each type of fixes independently.
This allows us in the end to do
What is the purpose of this pull request?