Skip to content

Commit 2a37ea5

Browse files
camc314taearls
authored andcommitted
fix(linter/tsgolint): report an error if tsgolint executable failed to spawn (oxc-project#12984)
1 parent 694abab commit 2a37ea5

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

apps/oxlint/src/tsgolint.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,20 @@ impl<'a> TsGoLintState<'a> {
9898
};
9999

100100
let handler = std::thread::spawn(move || {
101-
let child = std::process::Command::new(self.executable_path)
101+
let child = std::process::Command::new(&self.executable_path)
102102
.arg("headless")
103103
.stdin(std::process::Stdio::piped())
104104
.stdout(std::process::Stdio::piped())
105105
.spawn();
106106

107-
let Ok(mut child) = child else {
108-
// For now, silently ignore errors if `tsgolint` does not appear to be installed, or cannot
109-
// be spawned correctly.
110-
return Ok(());
107+
let mut child = match child {
108+
Ok(c) => c,
109+
Err(e) => {
110+
return Err(format!(
111+
"Failed to spawn tsgolint from path `{}`, with error: {e}",
112+
self.executable_path.display()
113+
));
114+
}
111115
};
112116

113117
let mut stdin = child.stdin.take().expect("Failed to open tsgolint stdin");

0 commit comments

Comments
 (0)