Skip to content

Commit b998634

Browse files
[autofix.ci] apply automated fixes
1 parent 3df2272 commit b998634

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

apps/oxlint/src-js/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,11 @@ function createContextAndVisitor(rule: CreateOnceRule): {
277277

278278
/**
279279
* Clear all loaded plugins and rules.
280-
*
280+
*
281281
* This function clears the internal state of registered plugins and rules,
282282
* allowing plugins to be reloaded from scratch. This is useful for the
283283
* language server when restarting or reloading configuration.
284-
*
284+
*
285285
* Note: This function is lazy-loaded and will only be available after
286286
* the first plugin has been loaded. It will not have any effect if no
287287
* plugins have been loaded yet.

apps/oxlint/src-js/plugins/load.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ function conformHookFn<H>(hookFn: H | null | undefined, hookName: string): H | n
274274

275275
/**
276276
* Clear all loaded plugins and rules.
277-
*
277+
*
278278
* This function clears the internal state of registered plugins and rules,
279279
* allowing plugins to be reloaded from scratch. This is useful for the
280280
* language server when restarting or reloading configuration.

apps/oxlint/src/js_plugins/external_linter.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ pub enum LintFileReturnValue {
6464
/// Wrap `clearLoadedPlugin` JS callback as a normal Rust function.
6565
///
6666
/// This function is called when the `ExternalLinter` is dropped to clear loaded plugin state.
67-
fn wrap_clear_loaded_plugin(cb: JsClearLoadedPluginCb) -> oxc_linter::ExternalLinterClearLoadedPluginCb {
67+
fn wrap_clear_loaded_plugin(
68+
cb: JsClearLoadedPluginCb,
69+
) -> oxc_linter::ExternalLinterClearLoadedPluginCb {
6870
Box::new(move || {
6971
// Call the JavaScript callback to clear loaded plugin state
7072
let _ = cb.call((), ThreadsafeFunctionCallMode::Blocking);

apps/oxlint/src/run.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,12 @@ pub type JsClearLoadedPluginCb = ThreadsafeFunction<
7979
#[expect(clippy::allow_attributes)]
8080
#[allow(clippy::trailing_empty_array, clippy::unused_async)] // https://github.com/napi-rs/napi-rs/issues/2758
8181
#[napi]
82-
pub async fn lint(args: Vec<String>, load_plugin: JsLoadPluginCb, lint_file: JsLintFileCb, clear_loaded_plugin: JsClearLoadedPluginCb) -> bool {
82+
pub async fn lint(
83+
args: Vec<String>,
84+
load_plugin: JsLoadPluginCb,
85+
lint_file: JsLintFileCb,
86+
clear_loaded_plugin: JsClearLoadedPluginCb,
87+
) -> bool {
8388
lint_impl(args, load_plugin, lint_file, clear_loaded_plugin).await.report() == ExitCode::SUCCESS
8489
}
8590

@@ -121,7 +126,11 @@ async fn lint_impl(
121126

122127
// JS plugins are only supported on 64-bit little-endian platforms at present
123128
#[cfg(all(target_pointer_width = "64", target_endian = "little"))]
124-
let external_linter = Some(super::js_plugins::create_external_linter(load_plugin, lint_file, clear_loaded_plugin));
129+
let external_linter = Some(super::js_plugins::create_external_linter(
130+
load_plugin,
131+
lint_file,
132+
clear_loaded_plugin,
133+
));
125134
#[cfg(not(all(target_pointer_width = "64", target_endian = "little")))]
126135
let external_linter = {
127136
let (_, _, _) = (load_plugin, lint_file, clear_loaded_plugin);

0 commit comments

Comments
 (0)