Skip to content

Comments

refactor(linter/plugins): add registerPlugin function#16210

Merged
graphite-app[bot] merged 1 commit intomainfrom
11-27-refactor_linter_plugins_add_registerplugin_function
Nov 27, 2025
Merged

refactor(linter/plugins): add registerPlugin function#16210
graphite-app[bot] merged 1 commit intomainfrom
11-27-refactor_linter_plugins_add_registerplugin_function

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Nov 27, 2025

Pure refactor. Move a few lines of code into loadPlugin, to leave a sync function registerPlugin which contains the logic for registering a plugin.

Required for #16206, which will call this method directly, skipping import-ing the plugin from a module.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-linter-plugins Area - Linter JS plugins C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Nov 27, 2025
Copy link
Member Author

overlookmotel commented Nov 27, 2025


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.

@overlookmotel overlookmotel marked this pull request as ready for review November 27, 2025 16:26
Copilot AI review requested due to automatic review settings November 27, 2025 16:26
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 the plugin loading logic by extracting the synchronous plugin registration logic from the async loadPluginImpl function into a new registerPlugin function. This separation prepares the codebase for #16206, which will need to register plugins directly without importing them from a module.

Key changes:

  • Renamed loadPluginImpl to registerPlugin and made it synchronous
  • Moved plugin import and duplicate registration check into loadPlugin
  • Updated JSDoc comments to reflect the new function signature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@overlookmotel overlookmotel self-assigned this Nov 27, 2025
@overlookmotel overlookmotel changed the base branch from main to graphite-base/16210 November 27, 2025 16:54
@overlookmotel overlookmotel force-pushed the 11-27-refactor_linter_plugins_add_registerplugin_function branch from 1302f61 to afc5df6 Compare November 27, 2025 16:54
@overlookmotel overlookmotel changed the base branch from graphite-base/16210 to 11-27-doc_linter_plugins_fix_jsdoc_comment_for_loadplugin_ November 27, 2025 16:54
@overlookmotel overlookmotel force-pushed the 11-27-refactor_linter_plugins_add_registerplugin_function branch from afc5df6 to df85032 Compare November 27, 2025 16:55
@overlookmotel overlookmotel force-pushed the 11-27-doc_linter_plugins_fix_jsdoc_comment_for_loadplugin_ branch 2 times, most recently from 9f3caf6 to c3526d7 Compare November 27, 2025 17:41
@overlookmotel overlookmotel force-pushed the 11-27-refactor_linter_plugins_add_registerplugin_function branch from df85032 to 54de704 Compare November 27, 2025 17:41
@graphite-app graphite-app bot changed the base branch from 11-27-doc_linter_plugins_fix_jsdoc_comment_for_loadplugin_ to graphite-base/16210 November 27, 2025 17:42
@graphite-app graphite-app bot force-pushed the graphite-base/16210 branch from c3526d7 to be36e36 Compare November 27, 2025 17:49
@graphite-app graphite-app bot force-pushed the 11-27-refactor_linter_plugins_add_registerplugin_function branch from 54de704 to be3b9ee Compare November 27, 2025 17:49
@graphite-app graphite-app bot changed the base branch from graphite-base/16210 to main November 27, 2025 17:49
@graphite-app graphite-app bot force-pushed the 11-27-refactor_linter_plugins_add_registerplugin_function branch from be3b9ee to 832983a Compare November 27, 2025 17:50
@overlookmotel overlookmotel force-pushed the 11-27-refactor_linter_plugins_add_registerplugin_function branch 2 times, most recently from b15c057 to 35ce097 Compare November 27, 2025 22:22
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Nov 27, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 27, 2025

Merge activity

Pure refactor. Move a few lines of code into `loadPlugin`, to leave a sync function `registerPlugin` which contains the logic for registering a plugin.

Required for #16206, which will call this method directly, skipping `import`-ing the plugin from a module.
@graphite-app graphite-app bot force-pushed the 11-27-refactor_linter_plugins_add_registerplugin_function branch from 35ce097 to c6245a4 Compare November 27, 2025 22:32
@graphite-app graphite-app bot merged commit c6245a4 into main Nov 27, 2025
18 checks passed
@graphite-app graphite-app bot deleted the 11-27-refactor_linter_plugins_add_registerplugin_function branch November 27, 2025 22:38
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 27, 2025
taearls pushed a commit to taearls/oxc that referenced this pull request Dec 11, 2025
…16210)

Pure refactor. Move a few lines of code into `loadPlugin`, to leave a sync function `registerPlugin` which contains the logic for registering a plugin.

Required for oxc-project#16206, which will call this method directly, skipping `import`-ing the plugin from a module.
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.

1 participant