fix(biome_js_analyze): correct text range of suppression reason#6711
Merged
ematipico merged 5 commits intobiomejs:mainfrom Jul 4, 2025
Merged
Conversation
🦋 Changeset detectedLatest commit: c696066 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
ematipico
approved these changes
Jul 4, 2025
Member
|
Another good one!! 😉 |
CodSpeed Performance ReportMerging #6711 will not alter performanceComparing Summary
|
Merged
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.
Summary
Fixes #6654.
This fixes a small bug in suppression comments handling: the reason range used to be inferred as "end of comment token minus reason length", which is wrong for block comments. This PR makes treatment of that field more strict, storing
reason_rangeas a relative offset from the beginning of the comment token. Added documentation to relevant fields.Test Plan
Added tests covering ignore comments with placeholders in reason field, both block-style and line-style, in JS and JSX tests. Grepped the codebase to ensure that
reason_rangeis not used anywhere else. I did not expand tests further to other comment styles as I consider tests inbiome_suppressionsufficiently comprehensive, JS/JSX tests were only to verify that relative to absolute conversion logic is correct.