Skip to content

Commit 2f20192

Browse files
committed
refactor(linter/plugins): move imports to top level
1 parent 7778e54 commit 2f20192

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

apps/oxlint/src/js_plugins/external_linter.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ use serde::Deserialize;
99

1010
use oxc_allocator::{Allocator, free_fixed_size_allocator};
1111
use oxc_linter::{
12-
ExternalLinter, ExternalLinterLintFileCb, ExternalLinterLoadPluginCb,
13-
ExternalLinterSetupRuleConfigsCb, LintFileResult, LoadPluginResult,
12+
ExternalLinter, ExternalLinterCreateWorkspaceCb, ExternalLinterDestroyWorkspaceCb,
13+
ExternalLinterLintFileCb, ExternalLinterLoadPluginCb, ExternalLinterSetupRuleConfigsCb,
14+
LintFileResult, LoadPluginResult,
1415
};
1516

1617
use crate::{
@@ -50,7 +51,7 @@ pub fn create_external_linter(
5051
/// until the `Promise` returned by the JS function resolves.
5152
///
5253
/// The returned function will panic if called outside of a Tokio runtime.
53-
fn wrap_create_workspace(cb: JsCreateWorkspaceCb) -> oxc_linter::ExternalLinterCreateWorkspaceCb {
54+
fn wrap_create_workspace(cb: JsCreateWorkspaceCb) -> ExternalLinterCreateWorkspaceCb {
5455
Arc::new(Box::new(move |workspace_uri| {
5556
let cb = &cb;
5657
let res = tokio::task::block_in_place(|| {
@@ -69,9 +70,7 @@ fn wrap_create_workspace(cb: JsCreateWorkspaceCb) -> oxc_linter::ExternalLinterC
6970
}
7071

7172
/// Wrap `destroyWorkspace` JS callback as a normal Rust function.
72-
fn wrap_destroy_workspace(
73-
cb: JsDestroyWorkspaceCb,
74-
) -> oxc_linter::ExternalLinterDestroyWorkspaceCb {
73+
fn wrap_destroy_workspace(cb: JsDestroyWorkspaceCb) -> ExternalLinterDestroyWorkspaceCb {
7574
Arc::new(Box::new(move |workspace_uri: String| {
7675
let _ = cb.call(FnArgs::from((workspace_uri,)), ThreadsafeFunctionCallMode::Blocking);
7776
}))

0 commit comments

Comments
 (0)