Skip to content

refactor(linter/plugins): add regex field to all tokens#19894

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/03-01-refactor_linter_plugins_add_regex_field_to_all_tokens
Mar 1, 2026
Merged

refactor(linter/plugins): add regex field to all tokens#19894
graphite-app[bot] merged 1 commit intomainfrom
om/03-01-refactor_linter_plugins_add_regex_field_to_all_tokens

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Mar 1, 2026

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

Copy link
Member Author

overlookmotel commented Mar 1, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: undefined to the shared token base shape.
  • Refactored RegularExpressionToken to define its own value and regex structure (instead of inheriting regex: undefined).
  • Updated token deserialization to always populate a regex property (either undefined or { 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.

@graphite-app graphite-app bot force-pushed the om/02-23-perf_linter_plugins_transfer_tokens_via_raw_transfer branch 2 times, most recently from 3f5a898 to 9518469 Compare March 1, 2026 20:11
@graphite-app graphite-app bot force-pushed the om/03-01-refactor_linter_plugins_add_regex_field_to_all_tokens branch from 55f7f5f to 9d2edfb Compare March 1, 2026 20:11
@overlookmotel overlookmotel force-pushed the om/02-23-perf_linter_plugins_transfer_tokens_via_raw_transfer branch from 9518469 to f7633c1 Compare March 1, 2026 21:20
@overlookmotel overlookmotel force-pushed the om/03-01-refactor_linter_plugins_add_regex_field_to_all_tokens branch from 9d2edfb to 5c3dace Compare March 1, 2026 21:20
@overlookmotel overlookmotel self-assigned this Mar 1, 2026
@overlookmotel overlookmotel force-pushed the om/03-01-refactor_linter_plugins_add_regex_field_to_all_tokens branch from 5c3dace to 6ea57ef Compare March 1, 2026 21:23
@overlookmotel overlookmotel force-pushed the om/02-23-perf_linter_plugins_transfer_tokens_via_raw_transfer branch from f7633c1 to eb9c0ad Compare March 1, 2026 21:38
@overlookmotel overlookmotel force-pushed the om/03-01-refactor_linter_plugins_add_regex_field_to_all_tokens branch from 6ea57ef to a707df9 Compare March 1, 2026 21:38
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Mar 1, 2026
Copy link
Member Author

overlookmotel commented Mar 1, 2026

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.
@graphite-app graphite-app bot force-pushed the om/02-23-perf_linter_plugins_transfer_tokens_via_raw_transfer branch from eb9c0ad to 05ccf9f Compare March 1, 2026 21:47
@graphite-app graphite-app bot force-pushed the om/03-01-refactor_linter_plugins_add_regex_field_to_all_tokens branch from a707df9 to 0072ae6 Compare March 1, 2026 21:47
Base automatically changed from om/02-23-perf_linter_plugins_transfer_tokens_via_raw_transfer to main March 1, 2026 21:54
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 1, 2026
@graphite-app graphite-app bot merged commit 0072ae6 into main Mar 1, 2026
20 checks passed
@graphite-app graphite-app bot deleted the om/03-01-refactor_linter_plugins_add_regex_field_to_all_tokens branch March 1, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter A-linter-plugins Area - Linter JS plugins C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants