diff --git a/apps/oxlint/src/lint.rs b/apps/oxlint/src/lint.rs index 7199332583e19..963e0a7355838 100644 --- a/apps/oxlint/src/lint.rs +++ b/apps/oxlint/src/lint.rs @@ -304,8 +304,8 @@ impl LintRunner { // Run type-aware linting through tsgolint // TODO: Add a warning message if `tsgolint` cannot be found, but type-aware rules are enabled if self.options.type_aware { - if let Err(err) = - TsGoLintState::new(config_store.clone(), &paths, &options).lint(tx_error.clone()) + if let Err(err) = TsGoLintState::new(options.cwd(), config_store.clone(), &paths) + .lint(tx_error.clone()) { print_and_flush_stdout(stdout, &err); return CliRunResult::TsGoLintError; diff --git a/crates/oxc_linter/src/tsgolint.rs b/crates/oxc_linter/src/tsgolint.rs index 001e9cd97cb1b..f871dddd1095e 100644 --- a/crates/oxc_linter/src/tsgolint.rs +++ b/crates/oxc_linter/src/tsgolint.rs @@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize}; use oxc_diagnostics::{DiagnosticSender, DiagnosticService, OxcDiagnostic, Severity}; use oxc_span::{SourceType, Span}; -use super::{AllowWarnDeny, ConfigStore, LintServiceOptions, ResolvedLinterState, read_to_string}; +use super::{AllowWarnDeny, ConfigStore, ResolvedLinterState, read_to_string}; /// State required to initialize the `tsgolint` linter. #[derive(Debug, Clone)] @@ -27,16 +27,11 @@ pub struct TsGoLintState<'a> { } impl<'a> TsGoLintState<'a> { - pub fn new( - config_store: ConfigStore, - paths: &'a Vec>, - options: &LintServiceOptions, - ) -> Self { + pub fn new(cwd: &Path, config_store: ConfigStore, paths: &'a Vec>) -> Self { TsGoLintState { config_store, - executable_path: try_find_tsgolint_executable(options.cwd()) - .unwrap_or(PathBuf::from("tsgolint")), - cwd: options.cwd().to_path_buf(), + executable_path: try_find_tsgolint_executable(cwd).unwrap_or(PathBuf::from("tsgolint")), + cwd: cwd.to_path_buf(), paths, } }