Skip to content

Commit 2796b16

Browse files
committed
fix(tsgolint): pipe tsgolints stderr (#14477)
Since we converted oxlint to a napi package, go's debug logging broke. It is unclear to me exactly why this broke, but this PR explicitly passes `stderr()`​ to the stderr handler of the child process which fixes ths issue. If anyone has any better ideas/solutions, please let me know. This blocks debugging/investigating oxc-project/tsgolint#288
1 parent 650ea68 commit 2796b16

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

crates/oxc_linter/src/tsgolint.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::{
22
collections::BTreeSet,
33
ffi::OsStr,
4-
io::{ErrorKind, Read, Write},
4+
io::{ErrorKind, Read, Write, stderr},
55
path::{Path, PathBuf},
66
sync::{Arc, Mutex},
77
};
@@ -87,7 +87,8 @@ impl TsGoLintState {
8787
let mut cmd = std::process::Command::new(&self.executable_path);
8888
cmd.arg("headless")
8989
.stdin(std::process::Stdio::piped())
90-
.stdout(std::process::Stdio::piped());
90+
.stdout(std::process::Stdio::piped())
91+
.stderr(stderr());
9192

9293
if let Ok(trace_file) = std::env::var("OXLINT_TSGOLINT_TRACE") {
9394
cmd.arg(format!("-trace={trace_file}"));

0 commit comments

Comments
 (0)