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 thefiles
array 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
composite
or using project references.Additional Tests
Added new tests to cover the following scenarios:
tsconfig.json
has an emptyfiles
array and valid child references.composite: true
but no references.--noEmit
flag, ensuring the flag works alongside the new diagnostics.When a
tsconfig.json
has an emptyfiles
array or lacks actionable tasks, it can be frustrating to debug why nothing happens. These updates aim to: