refactor(linter/plugins): add regex field to all tokens#19894
Merged
graphite-app[bot] merged 1 commit intomainfrom Mar 1, 2026
Merged
Conversation
This was referenced Mar 1, 2026
Member
Author
This was referenced Mar 1, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the tokens plugin token shape so every token object includes a regex field (set to undefined for non-regex tokens), aiming to keep a consistent object layout for potential performance/optimization benefits.
Changes:
- Added
regex: undefinedto the shared token base shape. - Refactored
RegularExpressionTokento define its ownvalueandregexstructure (instead of inheritingregex: undefined). - Updated token deserialization to always populate a
regexproperty (eitherundefinedor{ pattern, flags }).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| apps/oxlint/src-js/plugins/tokens.ts | Adds regex to all token objects and refactors regexp token typing + deserialization. |
| apps/oxlint/test/fixtures/tokens/output.snap.md | Updates token snapshot output to include regex: undefined for non-regex tokens. |
3f5a898 to
9518469
Compare
55f7f5f to
9d2edfb
Compare
9518469 to
f7633c1
Compare
9d2edfb to
5c3dace
Compare
5c3dace to
6ea57ef
Compare
f7633c1 to
eb9c0ad
Compare
6ea57ef to
a707df9
Compare
Member
Author
Merge activity
|
Add `regex: undefined` field to all tokens. Consistent object shape for all tokens may produce better performance, and enable other optimizations later on.
eb9c0ad to
05ccf9f
Compare
a707df9 to
0072ae6
Compare
Base automatically changed from
om/02-23-perf_linter_plugins_transfer_tokens_via_raw_transfer
to
main
March 1, 2026 21:54
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.

Add
regex: undefinedfield to all tokens. Consistent object shape for all tokens may produce better performance, and enable other optimizations later on.