Skip to content

fix(tsc): guard "No errors found" behind exit code - #3295

Open
NekomyaDev wants to merge 1 commit into
rtk-ai:developfrom
NekomyaDev:fix-tsc-false-positive-dev
Open

fix(tsc): guard "No errors found" behind exit code#3295
NekomyaDev wants to merge 1 commit into
rtk-ai:developfrom
NekomyaDev:fix-tsc-false-positive-dev

Conversation

@NekomyaDev

Copy link
Copy Markdown

Closes #3220. (Re-targeted to develop per CONTRIBUTING.md — supersedes #3294.)

Problem

TscHandler::format_summary ignored the process exit code: whenever zero parseable TS#### errors were captured, it returned TypeScript: No errors found — even when tsc exited non-zero without emitting parseable diagnostics (e.g. missing tsconfig.json, invalid compiler flags, fatal config errors like TS5058). The filter could therefore report success on a failed run.

Fix

format_summary now guards on exit_code:

  • exit_code == 0 + no parseable errors → unchanged: TypeScript: No errors found
  • exit_code != 0 + no parseable errors → reports TypeScript: failed (exit code N) with no parseable TS errors and appends the last 10 non-empty lines of raw output so the fatal diagnostic (which the streaming filter otherwise drops) stays visible

Tests

Two new regression tests:

  • test_tsc_stream_failure_without_parseable_errors — non-zero exit with only a fatal TS5058 line must not contain "No errors found", must surface exit code and the fatal line
  • test_tsc_stream_success_still_reports_no_errors — zero exit with empty output still reports "No errors found"

All existing tsc streaming/filter tests are unaffected (the success path is unchanged).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tsc filter: "TypeScript: No errors found" is printed on a non-zero exit, so a tsc that never ran reads as a clean typecheck

1 participant