Add minimal tsc output format#3698
Draft
JoviDeCroock wants to merge 1 commit intomicrosoft:mainfrom
Draft
Conversation
jakebailey
reviewed
May 4, 2026
| }, | ||
| }) | ||
|
|
||
| want := "src/index.ts:1:17: TS2322: Type 'number' is not assignable to type 'string'. | The expected type comes from property 'x'\n" |
Member
There was a problem hiding this comment.
You should be writing end-to-end tests in tsctests, not unit tests here (or elsehwere, really)
Author
There was a problem hiding this comment.
Thank you for the feedback, very new to GO so appreciate you chiming in quickly here. The tests were generated ahead of time by an LLM so I had something sane to work against.
I explicitly left it in Draft for that reason so we could talk through the desire for this feature. I think it could be valuable in terms of working towards a future where we save tokens of diagnostics coming from testing/linting/...
e22ba95 to
0dd2de9
Compare
Author
|
@microsoft-github-policy-service agree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an explicit
--outputFormat minimalcommand-line option fortsgodiagnostics. The minimal reporter emits one diagnostic per line in the form:This keeps the default output unchanged while giving tooling and agents a compact, stable format that is easier to parse and significantly cheaper to feed back into LLM context windows.
Motivation
AI coding agents frequently run
tsc/tsgoand then include the compiler output in the next prompt. The existing pretty/default diagnostics are excellent for humans, but they include context, spacing, colors, and multi-line message chains that add a lot of tokens. A compact output format reduces token usage and makes repeated fix/test loops less noisy without taking away the current default human-facing experience.As a future follow-up, we could also auto-select this format when
tsgois run by an agent. A similar principle is being explored in oxc by detecting agent-specific environment variables and switching to an agent-oriented output format: oxc-project/oxc#22068. That PR mirrors the environment detection used byunjs/std-envagents detection, which is also used by tools like Vitest.