refactor(linter/plugins): more debug assertions in initTokensWithComments#16116
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Pull request overview
This PR refactors debug assertions in the initTokensWithComments function by extracting the validation logic into a separate debugCheckTokensWithComments function. The new function provides more comprehensive checks that verify not only the length but also the correct ordering of merged tokens and comments. These assertions are only active in debug builds and are completely removed by the minifier in production.
Key Changes:
- Extracted debug validation logic into a dedicated
debugCheckTokensWithCommentsfunction - Enhanced validation to verify both length and ordering of merged tokens/comments
- Added check to detect duplicate token/comment start positions
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b0d1695 to
14f7b51
Compare
Merge activity
|
14f7b51 to
74e1f3d
Compare
…ments` (oxc-project#16116) Follow-on after oxc-project#16071. Add more debug assertions to ensure `comments` and `tokens` are merged correctly. This code is removed in release build - just for tests.

Follow-on after #16071. Add more debug assertions to ensure
commentsandtokensare merged correctly. This code is removed in release build - just for tests.