Repository navigation
Conversation
Oxlint reports UTF-8 byte columns and lengths. Using those values as monospace character counts can move the underline past its token or extend it beyond the last letter. Measure both byte endpoints against the highlighted source saved with the report. Use that range for the underline and its rule connector, including insertion points on empty lines.
@vitejs/devtools
@vitejs/devtools-kit
@vitejs/devtools-oxc
@vitejs/devtools-rolldown
@vitejs/devtools-vite
@vitejs/devtools-vite-task
@vitejs/devtools-vitest
commit: |
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
In Oxc Lint Inspector, a multibyte character before a diagnostic can move the underline to the right of the reported code. A multibyte character inside the marked text can make the underline too wide. Oxlint reports positions in UTF-8 bytes, and the inspector used each byte as one character cell.
The inspector now maps both ends of the byte range to the highlighted text saved with the lint run. It measures that text in the browser, draws the underline to fit and connects the rule label at the midpoint.
Evidence
Before: With twelve
écharacters beforedebugger;, the underline started 115.58 CSS pixels to the right of the statement.After: The underline matches both ends of
debugger;. The underline forcafé, previously 9.66 CSS pixels too wide, also matches both ends.In Chromium, all 12 nonempty spans matched the displayed text in both the full-page and embedded views. Reopening the saved run after editing the files preserved the original text and marker positions.
Merge Danger
Door: Two-way. The change only affects rendering. A revert needs no data migration.
Blast Radius: Oxc. Every lint result uses the same marker calculation. A positioning error can underline the wrong token even on a plain ASCII line. The shared highlighter also renders configuration previews.