Fixes: #60479 - Change the behavior of tsc on a tsconfig solution #60574
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.
Fixes #60479
This PR improves the TypeScript compiler's behavior when encountering ambiguous configurations in
tsconfig.json, such as when thefilesarray is empty. The goal is to ensure users get clear, actionable feedback instead of silent failures or confusing results.New Diagnostic Added
A new error message, TS6042, helps developers understand what to do when there’s no actionable task in their configuration.
Example message: "No actionable task. Add 'composite': true, valid 'references', or use 'tsc -b'."
Clearer Guidance for Edge Cases
Handles configurations like
files: [], ensuring diagnostics are surfaced instead of failing silently.Helps developers understand best practices, such as enabling
compositeor using project references.Additional Tests
Added new tests to cover the following scenarios:
tsconfig.jsonhas an emptyfilesarray and valid child references.composite: truebut no references.--noEmitflag, ensuring the flag works alongside the new diagnostics.When a
tsconfig.jsonhas an emptyfilesarray or lacks actionable tasks, it can be frustrating to debug why nothing happens. These updates aim to: