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 @@ -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;
Expand Down
13 changes: 4 additions & 9 deletions crates/oxc_linter/src/tsgolint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -27,16 +27,11 @@ pub struct TsGoLintState<'a> {
}

impl<'a> TsGoLintState<'a> {
pub fn new(
config_store: ConfigStore,
paths: &'a Vec<Arc<OsStr>>,
options: &LintServiceOptions,
) -> Self {
pub fn new(cwd: &Path, config_store: ConfigStore, paths: &'a Vec<Arc<OsStr>>) -> 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,
}
}
Expand Down
Loading