feat!: Program range span entire source text#677
Merged
mdjermanovic merged 3 commits intoeslint:mainfrom Nov 6, 2025
Merged
Conversation
4 tasks
Member
|
Is this ready to review? |
Contributor
Author
|
@fasttime Yes |
Member
|
I tested this with ESLint and didn't see any incorrect behavior. A few unit tests were failing or no longer consistent (e.g., "should retrieve comments after a Program node"), but that's expected given the changes. The core logic and rule implementations appeared to be still working without additional modifications. |
fasttime
previously approved these changes
Sep 17, 2025
Member
fasttime
left a comment
There was a problem hiding this comment.
LGTM, thanks! Waiting for a second review.
1 task
Member
|
There's a merge conflict now. |
Pixel998
added a commit
to Pixel998/eslint
that referenced
this pull request
Sep 26, 2025
Merged
mdjermanovic
pushed a commit
to eslint/eslint
that referenced
this pull request
Nov 10, 2025
* chore: align tests with `Program` range change * update espree * update test * use the branch of eslint/js#677 to test changes * correct index calc in `utils.getFirstIndex/getLastIndex` * avoid using search() in getFirstIndex() and getLastIndex() * update migration guide * update espree
1 task
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
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.
Prerequisites checklist
Program's range currently works as follows:
What is the purpose of this pull request?
This PR updates Program’s range and loc so that they always cover the entire source text, regardless of tokens.
Programrange start is 0.Programrange end is length of the source text.locfollows the same pattern. i.e.:loc.startis always{ line: 1, column: 0 }loc.end.lineis the number of lines in the source text.loc.end.columnis the number of characters in last line of source text.What changes did you make? (Give an overview)
Related Issues
Fix #648
Is there anything you'd like reviewers to focus on?