-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Fix #60479 - Change the behavior of tsc on a tsconfig solution #60501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #60479 - Change the behavior of tsc on a tsconfig solution #60501
Conversation
@microsoft-github-policy-service agree |
Fix #60479 Diagnostic warning for
tsc --noEmitwhen using solution-styletsconfig.jsonSummary
This PR adds a diagnostic warning when
tscis run with--noEmitin a solution-style setup wheretsconfig.jsonhas:noEmitset totruefilesarrayreferencesdefinedContext
The motivation for this change is to help users avoid a common point of confusion. With this configuration, many users expect
tscto handle project references, but--noEmitprevents any output, and until now,tschasn’t shown any guidance. The new warning suggests usingtsc -b, which is the recommended command for managing builds with project references.Changes Made
New Diagnostic Message: Adds a warning when
noEmitis set to true withfiles: []andreferencesdefined, suggesting the use oftsc -b."Detected an empty 'files' array with project 'references'. Consider using 'tsc -b' for correct handling of project references."Files Updated:
commandLineParser.ts: Adds logic to check for the misconfiguration and issue the new diagnostic.diagnosticMessages.json: Adds the new diagnostic message.Example
For a setup like this:
{ "compilerOptions": { "noEmit": true }, "files": [], "references": [ { "path": "./lib" } ] }Running
tsc --noEmitwill now output the following warning: