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
4 changes: 2 additions & 2 deletions apps/oxlint/src/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,14 @@ impl LintRunner {
// Spawn linting in another thread so diagnostics can be printed immediately from diagnostic_service.run.
rayon::spawn(move || {
let mut lint_service = LintService::new(linter, allocator_pool, options);
let _ = lint_service.with_paths(paths);
lint_service.with_paths(paths);

// Use `RawTransferFileSystem` if `oxlint2` feature is enabled.
// This reads the source text into start of allocator, instead of the end.
#[cfg(all(feature = "oxlint2", not(feature = "disable_oxlint2")))]
{
use crate::raw_fs::RawTransferFileSystem;
let _ = lint_service.with_file_system(Box::new(RawTransferFileSystem));
lint_service.with_file_system(Box::new(RawTransferFileSystem));
}

lint_service.run(&tx_error);
Expand Down
2 changes: 0 additions & 2 deletions crates/oxc_linter/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ impl LintService {
Self { runtime }
}

#[must_use]
pub fn with_file_system(
&mut self,
file_system: Box<dyn RuntimeFileSystem + Sync + Send>,
Expand All @@ -84,7 +83,6 @@ impl LintService {
self
}

#[must_use]
pub fn with_paths(&mut self, paths: Vec<Arc<OsStr>>) -> &mut Self {
self.runtime.with_paths(paths);
self
Expand Down
4 changes: 2 additions & 2 deletions crates/oxc_linter/src/service/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,12 @@ impl Runtime {
pub fn with_file_system(
&mut self,
file_system: Box<dyn RuntimeFileSystem + Sync + Send>,
) -> &Self {
) -> &mut Self {
self.file_system = file_system;
self
}

pub fn with_paths(&mut self, paths: Vec<Arc<OsStr>>) -> &Self {
pub fn with_paths(&mut self, paths: Vec<Arc<OsStr>>) -> &mut Self {
self.paths = paths.into_iter().collect();
self
}
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_linter/src/tester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ impl Tester {
let paths = vec![Arc::<OsStr>::from(path_to_lint.as_os_str())];
let options = LintServiceOptions::new(cwd).with_cross_module(self.plugins.has_import());
let mut lint_service = LintService::new(linter, AllocatorPool::default(), options);
let _ = lint_service
lint_service
.with_file_system(Box::new(TesterFileSystem::new(
path_to_lint,
source_text.to_string(),
Expand Down
Loading