Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions crates/oxc_linter/src/external_linter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,8 @@ pub type ExternalLinterLoadPluginCb = Arc<
+ 'static,
>;

pub type ExternalLinterLintFileCb = Arc<
dyn Fn(
String,
Vec<u32>,
&Allocator,
) -> Result<Vec<LintFileResult>, Box<dyn std::error::Error + Send + Sync>>
+ Sync
+ Send,
>;
pub type ExternalLinterLintFileCb =
Arc<dyn Fn(String, Vec<u32>, &Allocator) -> Result<Vec<LintFileResult>, String> + Sync + Send>;

#[derive(Clone, Debug, Deserialize, Serialize)]
pub enum PluginLoadResult {
Expand Down
6 changes: 3 additions & 3 deletions napi/oxlint2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ fn wrap_lint_file(cb: JsLintFileCb) -> ExternalLinterLintFileCb {
);

if status != Status::Ok {
return Err(format!("Failed to schedule callback: {status:?}").into());
return Err(format!("Failed to schedule callback: {status:?}"));
}

match rx.recv() {
Ok(Ok(x)) => Ok(x),
Ok(Err(e)) => Err(format!("Callback reported error: {e}").into()),
Err(e) => Err(format!("Callback did not respond: {e}").into()),
Ok(Err(e)) => Err(format!("Callback reported error: {e}")),
Err(e) => Err(format!("Callback did not respond: {e}")),
}
})
}
Expand Down
Loading