Skip to content

bug(tsc): informational output (--showConfig, --listFiles, --init, --help) is replaced by "TypeScript: No errors found" and is unrecoverable #3750

Open

Description

@KuSh

Summary

Every tsc invocation goes through BlockStreamFilter — src/cmds/js/tsc_cmd.rs::run() has no passthrough. When the compiler exits 0 and emits nothing the block handler recognises as a diagnostic, format_summary returns TypeScript: No errors found and the real output is discarded.

That is correct for an actual clean typecheck, but wrong for every informational subcommand:

rtk tsc --showConfig    # JSON config      -> "TypeScript: No errors found"
rtk tsc --listFiles     # file list        -> "TypeScript: No errors found"
rtk tsc --init          # created tsconfig -> "TypeScript: No errors found"
rtk tsc --help          # help text        -> "TypeScript: No errors found"
rtk tsc -v              # version          -> "TypeScript: No errors found"

Why it is unrecoverable

Unlike the non-zero-exit path, there is no tee fallback. TeeConfig defaults to TeeMode::Failures (src/core/tee.rs:325), and should_tee returns None when exit_code == 0 (src/core/tee.rs:~103). No raw file is written and no recovery hint is printed, so the output is simply gone — rtk proxy tsc --showConfig is the only way to get it back.

Cause

src/cmds/js/tsc_cmd.rs, TscHandler::format_summary:

if self.error_count == 0 {
    if exit_code == 0 {
        return Some("TypeScript: No errors found\n".to_string());
    }
    // ... non-zero path reports the failure with a head/tail of raw
}

BlockStreamFilter drops any line that is neither a block start nor a continuation, so the JSON / file list / help text never reaches stdout, and the summary asserts a typecheck that never happened.

Scope note

This is pre-existing, not a regression: before #2232 the same function returned TypeScript: No errors found unconditionally whenever error_count == 0. #2232 hardened the exit_code != 0 half (that is #3220); this issue is the exit-0 half, filed separately so #2232 does not grow.

Suggested fix

Either:

  1. Guard the success summary on "exit 0 and raw output is trivial", passing raw through otherwise — the analogue of the non-zero branch; or
  2. Detect informational flags in run() (--showConfig, --listFiles, --listFilesOnly, --init, --help, -h, --version, -v) and route them straight to passthrough, which is cheaper and has no false-negative risk.

Option 2 is narrower and matches how other filters special-case non-diagnostic subcommands.

Related

Activity

  1. rtk-release-bot commented on Nov 30, 2026

    @rtk-release-bot
    Contributor

    This issue has been automatically marked as stale due to 90 days of inactivity. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions