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
3 changes: 1 addition & 2 deletions apps/oxlint/src/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1215,9 +1215,8 @@ mod test {
}

// ToDo: `tsgolint` does not support `big-endian`?
// ToDo: windows: my guess is the missing `.exe` suffix when searching
#[test]
#[cfg(not(any(target_os = "windows", target_endian = "big")))]
#[cfg(not(target_endian = "big"))]
fn test_tsgolint() {
let args = &["--type-aware"];
Tester::new().with_cwd("fixtures/tsgolint".into()).test_and_snapshot(args);
Expand Down
6 changes: 5 additions & 1 deletion apps/oxlint/src/tsgolint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,14 @@ pub fn try_find_tsgolint_executable(cwd: &Path) -> Option<PathBuf> {
}
}

// executing a sub command in windows, needs a `cmd` or `ps1` extension.
// `cmd` is the most compatible one with older systems
let file = if cfg!(windows) { "tsgolint.CMD" } else { "tsgolint" };

// Move upwards until we find a `package.json`, then look at `node_modules/.bin/tsgolint`
let mut current_dir = cwd.to_path_buf();
loop {
let node_modules_bin = current_dir.join("node_modules").join(".bin").join("tsgolint");
let node_modules_bin = current_dir.join("node_modules").join(".bin").join(file);
if node_modules_bin.exists() {
return Some(node_modules_bin);
}
Expand Down
Loading