diff --git a/apps/oxlint/src/command/lint.rs b/apps/oxlint/src/command/lint.rs index c5c130c70ce394..9bcdbd598926a5 100644 --- a/apps/oxlint/src/command/lint.rs +++ b/apps/oxlint/src/command/lint.rs @@ -68,7 +68,7 @@ pub struct BasicOptions { /// TypeScript `tsconfig.json` path for reading path alias and project references for import plugin #[bpaf(argument("./tsconfig.json"), hide_usage)] pub tsconfig: Option, - + /// The working directory where oxlint should be executed /// defaults to `env::current_dir()` #[bpaf(long("working-dir"), hide_usage)] diff --git a/apps/oxlint/src/lint.rs b/apps/oxlint/src/lint.rs index 274f038bddc854..4f64829387357e 100644 --- a/apps/oxlint/src/lint.rs +++ b/apps/oxlint/src/lint.rs @@ -52,16 +52,19 @@ impl Runner for LintRunner { let now = Instant::now(); let mut cwd = env::current_dir().expect("Failed to get current working directory"); - + // append the working directory paths if let Some(working_dir) = basic_options.working_dir { cwd.push(working_dir); - paths = paths.into_iter().map(|x| { - let mut new = cwd.clone(); - new.push(x); - new - }).collect() + paths = paths + .into_iter() + .map(|x| { + let mut new = cwd.clone(); + new.push(x); + new + }) + .collect() } // The ignore crate whitelists explicit paths, but priority