Skip to content

refactor(estree/tokens): shorten code#19868

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

refactor(estree/tokens): shorten code#19868
graphite-app[bot] merged 1 commit intomainfrom
om/03-01-refactor_estree_tokens_shorten_code

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Mar 1, 2026

Pure refactor. Replace repetitious code with a shared method.

@github-actions github-actions bot added the C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior label Mar 1, 2026
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 refactors RawContext’s token-kind mutation logic by extracting repeated “advance to token and set kind” code into a shared helper, keeping behavior the same while reducing duplication.

Changes:

  • Add a RawContext::set_kind_at(start, kind) helper to centralize “advance + set kind”.
  • Update emit_this_identifier_at, emit_jsx_identifier_at, and emit_string_literal_as_jsx_text to use the new helper.

@overlookmotel overlookmotel self-assigned this Mar 1, 2026
@overlookmotel overlookmotel added A-parser Area - Parser A-linter-plugins Area - Linter JS plugins labels Mar 1, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 1, 2026

Merging this PR will not alter performance

✅ 53 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing om/03-01-refactor_estree_tokens_shorten_code (13e7557) with om/03-01-refactor_estree_tokens_make_context_methods_take_ast_nodes (c919ce9)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@overlookmotel overlookmotel changed the base branch from om/03-01-refactor_estree_tokens_make_context_methods_take_ast_nodes to graphite-base/19868 March 1, 2026 16:38
@overlookmotel overlookmotel force-pushed the om/03-01-refactor_estree_tokens_shorten_code branch from 13e7557 to 3226c14 Compare March 1, 2026 16:40
@overlookmotel overlookmotel changed the base branch from graphite-base/19868 to om/03-01-refactor_estree_tokens_make_context_methods_take_ast_nodes March 1, 2026 16:40
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Mar 1, 2026
@graphite-app graphite-app bot changed the base branch from om/03-01-refactor_estree_tokens_make_context_methods_take_ast_nodes to graphite-base/19868 March 1, 2026 16:46
@graphite-app graphite-app bot force-pushed the graphite-base/19868 branch from 28983f9 to 1d7adf0 Compare March 1, 2026 16:58
@graphite-app graphite-app bot force-pushed the om/03-01-refactor_estree_tokens_shorten_code branch from 3226c14 to 8c93213 Compare March 1, 2026 16:58
@graphite-app graphite-app bot changed the base branch from graphite-base/19868 to main March 1, 2026 16:59
@graphite-app graphite-app bot force-pushed the om/03-01-refactor_estree_tokens_shorten_code branch from 8c93213 to 700f55e Compare March 1, 2026 16:59
@graphite-app
Copy link
Contributor

graphite-app bot commented Mar 1, 2026

Merge activity

Pure refactor. Replace repetitious code with a shared method.
@graphite-app graphite-app bot force-pushed the om/03-01-refactor_estree_tokens_shorten_code branch from 700f55e to 26b0a7d Compare March 1, 2026 17:07
@graphite-app graphite-app bot merged commit 26b0a7d into main Mar 1, 2026
21 checks passed
@graphite-app graphite-app bot deleted the om/03-01-refactor_estree_tokens_shorten_code branch March 1, 2026 17:13
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter-plugins Area - Linter JS plugins A-parser Area - Parser 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