Skip to content

refactor(linter/plugins): combine functions to generate merge functions#20315

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/03-10-refactor_linter_plugins_combine_functions_to_generate_merge_functions
Mar 13, 2026
Merged

refactor(linter/plugins): combine functions to generate merge functions#20315
graphite-app[bot] merged 1 commit intomainfrom
om/03-10-refactor_linter_plugins_combine_functions_to_generate_merge_functions

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Mar 13, 2026

Previously we had 2 functions specialized for generating merger functions for AST node visit functions and CFG event handler functions. Merge them into 1. This reduces the amount of code and makes it clearer.

Copy link
Member Author

overlookmotel commented Mar 13, 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 changes, fast-track this PR to the front of 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.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-linter-plugins Area - Linter JS plugins labels Mar 13, 2026
@github-actions github-actions bot added the C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior label Mar 13, 2026
@overlookmotel overlookmotel marked this pull request as ready for review March 13, 2026 00:33
@overlookmotel overlookmotel requested a review from camc314 as a code owner March 13, 2026 00:33
Copilot AI review requested due to automatic review settings March 13, 2026 00:33
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

Refactors the visitor compiler in apps/oxlint by consolidating separate AST-visit and CFG-event merger generators into a single createMerger implementation, reducing duplicated code while keeping the existing “predefined up to 5” fast paths.

Changes:

  • Replaces the separate CFG merger generator with a unified createMerger(fnCount, isCfg) that emits either (n)=>{...} or (...a)=>{...} dispatch.
  • Updates dynamic-merger warmup paths for both AST visitors and CFG visitors to use the unified generator.
  • Removes the now-redundant createCfgMerger function and documents the generated code shapes.

@overlookmotel overlookmotel self-assigned this Mar 13, 2026
@overlookmotel overlookmotel changed the base branch from om/03-10-perf_linter_plugins_move_creating_merger_functions_off_hot_path to graphite-base/20315 March 13, 2026 01:19
@overlookmotel overlookmotel force-pushed the om/03-10-refactor_linter_plugins_combine_functions_to_generate_merge_functions branch from 6e6a360 to 94f4029 Compare March 13, 2026 01:19
@graphite-app graphite-app bot force-pushed the om/03-10-refactor_linter_plugins_combine_functions_to_generate_merge_functions branch from 94f4029 to d90493a Compare March 13, 2026 01:42
@graphite-app graphite-app bot force-pushed the graphite-base/20315 branch from 0e1f716 to 3b9eb28 Compare March 13, 2026 01:42
@graphite-app graphite-app bot changed the base branch from graphite-base/20315 to main March 13, 2026 01:43
@graphite-app graphite-app bot force-pushed the om/03-10-refactor_linter_plugins_combine_functions_to_generate_merge_functions branch from d90493a to 0bb4224 Compare March 13, 2026 01:43
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Mar 13, 2026
@graphite-app
Copy link
Contributor

graphite-app bot commented Mar 13, 2026

Merge activity

…ns (#20315)

Previously we had 2 functions specialized for generating merger functions for AST node visit functions and CFG event handler functions. Merge them into 1. This reduces the amount of code and makes it clearer.
@graphite-app graphite-app bot force-pushed the om/03-10-refactor_linter_plugins_combine_functions_to_generate_merge_functions branch from 0bb4224 to 9163428 Compare March 13, 2026 01:58
@graphite-app graphite-app bot merged commit 9163428 into main Mar 13, 2026
19 checks passed
@graphite-app graphite-app bot deleted the om/03-10-refactor_linter_plugins_combine_functions_to_generate_merge_functions branch March 13, 2026 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0-merge Merge with Graphite Merge Queue 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