refactor(linter/plugins): simplify JS callback type#16452
refactor(linter/plugins): simplify JS callback type#16452graphite-app[bot] merged 1 commit intomainfrom
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via 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. |
CodSpeed Performance ReportMerging #16452 will not alter performanceComparing Summary
Footnotes
|
There was a problem hiding this comment.
Pull request overview
This PR refactors the ExternalLinterLoadPluginCb type to simplify error handling by using String directly as the error type instead of Box<dyn Error + Send + Sync>. The error-to-string conversion is now performed within the wrap_load_plugin closure, making the type definition cleaner and more consistent with other external linter callback types.
Key changes:
- Simplified the
ExternalLinterLoadPluginCbtype signature to useResult<PluginLoadResult, String> - Moved error-to-string conversion logic into
wrap_load_pluginusingmap_err - Updated error handling in
config_builder.rsto directly use the string error without additional conversion
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
crates/oxc_linter/src/external_linter.rs |
Simplified ExternalLinterLoadPluginCb type to use String for errors, removed unused Error import |
crates/oxc_linter/src/config/config_builder.rs |
Updated error handling to directly use string errors from the callback without calling .to_string() |
apps/oxlint/src/js_plugins/external_linter.rs |
Added Error import and moved error-to-string conversion into wrap_load_plugin via map_err |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|
Simplify the type for `ExternalLinterLoadPluginCb` by converting errors to `String`s in the closure returned by `wrap_load_plugin`, rather than doing it later.
c4a2c99 to
c869ee1
Compare
Simplify the type for `ExternalLinterLoadPluginCb` by converting errors to `String`s in the closure returned by `wrap_load_plugin`, rather than doing it later.

Simplify the type for
ExternalLinterLoadPluginCbby converting errors toStrings in the closure returned bywrap_load_plugin, rather than doing it later.