From 2796b16c7e9e0f4a8206cb1f37c399831a4dfde5 Mon Sep 17 00:00:00 2001 From: camc314 <18101008+camc314@users.noreply.github.com> Date: Fri, 10 Oct 2025 15:53:44 +0000 Subject: [PATCH] fix(tsgolint): pipe tsgolints stderr (#14477) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 https://github.com/oxc-project/tsgolint/issues/288 --- crates/oxc_linter/src/tsgolint.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/oxc_linter/src/tsgolint.rs b/crates/oxc_linter/src/tsgolint.rs index 37d44da5560c7..7fbbd722cb020 100644 --- a/crates/oxc_linter/src/tsgolint.rs +++ b/crates/oxc_linter/src/tsgolint.rs @@ -1,7 +1,7 @@ use std::{ collections::BTreeSet, ffi::OsStr, - io::{ErrorKind, Read, Write}, + io::{ErrorKind, Read, Write, stderr}, path::{Path, PathBuf}, sync::{Arc, Mutex}, }; @@ -87,7 +87,8 @@ impl TsGoLintState { let mut cmd = std::process::Command::new(&self.executable_path); cmd.arg("headless") .stdin(std::process::Stdio::piped()) - .stdout(std::process::Stdio::piped()); + .stdout(std::process::Stdio::piped()) + .stderr(stderr()); if let Ok(trace_file) = std::env::var("OXLINT_TSGOLINT_TRACE") { cmd.arg(format!("-trace={trace_file}"));