diff --git a/crates/oxc_cli/src/lint/runner.rs b/crates/oxc_cli/src/lint/runner.rs index 4af012fe8..58d1ec1f9 100644 --- a/crates/oxc_cli/src/lint/runner.rs +++ b/crates/oxc_cli/src/lint/runner.rs @@ -65,12 +65,10 @@ impl LintRunner { let fix = options.fix; rayon::join( move || { - options.paths.iter().flat_map(|path| Walk::new(path, options).iter()).for_each( - |path| { - *number_of_files += 1; - tx_path.send(path).unwrap(); - }, - ) + Walk::new(options).iter().for_each(|path| { + *number_of_files += 1; + tx_path.send(path).unwrap(); + }); }, move || { while let Ok(path) = rx_path.recv() { diff --git a/crates/oxc_cli/src/walk.rs b/crates/oxc_cli/src/walk.rs index 8cd2901e6..a0bc201e6 100644 --- a/crates/oxc_cli/src/walk.rs +++ b/crates/oxc_cli/src/walk.rs @@ -10,8 +10,16 @@ pub struct Walk { } impl Walk { - pub fn new>(path: P, options: &LintOptions) -> Self { - let mut inner = WalkBuilder::new(path); + #[must_use] + pub fn new(options: &LintOptions) -> Self { + let mut inner = WalkBuilder::new(&options.paths[0]); + + if let Some(paths) = options.paths.get(1..) { + for path in paths { + inner.add(path); + } + } + if !options.no_ignore { inner.add_custom_ignore_filename(&options.ignore_path); }