Skip to content

fix(biome_js_analyze): correct text range of suppression reason#6711

Merged
ematipico merged 5 commits intobiomejs:mainfrom
sterliakov:bugfix/gh-6654-suppression-highlight
Jul 4, 2025
Merged

fix(biome_js_analyze): correct text range of suppression reason#6711
ematipico merged 5 commits intobiomejs:mainfrom
sterliakov:bugfix/gh-6654-suppression-highlight

Conversation

@sterliakov
Copy link
Copy Markdown
Contributor

@sterliakov sterliakov commented Jul 4, 2025

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_range as 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_range is not used anywhere else. I did not expand tests further to other comment styles as I consider tests in biome_suppression sufficiently comprehensive, JS/JSX tests were only to verify that relative to absolute conversion logic is correct.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jul 4, 2025

🦋 Changeset detected

Latest commit: c696066

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

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

@github-actions github-actions Bot added A-Core Area: core A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Jul 4, 2025
@ematipico
Copy link
Copy Markdown
Member

Another good one!! 😉

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jul 4, 2025

CodSpeed Performance Report

Merging #6711 will not alter performance

Comparing sterliakov:bugfix/gh-6654-suppression-highlight (c696066) with main (19aab18)

Summary

✅ 114 untouched benchmarks

@ematipico ematipico merged commit 1937691 into biomejs:main Jul 4, 2025
29 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Core Area: core A-Linter Area: linter L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

💅 Misplaced highlight of suppressions/incorrect in JSX

2 participants