- Notifications
You must be signed in to change notification settings - Fork12.9k
Fix --showConfig to work when no input files are found#62047
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Runnpx hereby format
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
Formatting has been run successfully with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Instead of filtering, we can just do this in the other order. Write the outputthen issue diagnostics and exit.
Runnpx hereby format
again once you're doing with your changes
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
I've refactored the implementation to write the output first, then issue diagnostics as suggested. This is cleaner than filtering specific error codes. The config is now always shown when --showConfig is used, and all diagnostics are still properly reported afterward. Formatting has been applied. See commitf1c7d72. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Runnpx hereby runtest-parallel
, WAIT FOR IT TO FINISH (20 minutes or more?), and submit the new baselines
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
I've run |
Uh oh!
There was an error while loading.Please reload this page.
Summary
The
--showConfig
flag was incorrectly failing when no input files matched the include patterns, even though its purpose is to display the parsed configuration without compilation. This change allows--showConfig
to work properly regardless of whether input files are present.Problem
Previously, running
tsc --showConfig
with a configuration like:...in an empty directory would fail with:
Solution
Modified
executeCommandLine.ts
to filter out "No inputs were found" errors (TS18003) when the--showConfig
flag is used, since the purpose is to show configuration, not to compile files.Behavior
Before:
After:
Other errors (like invalid compiler options) are still properly reported when using
--showConfig
.Testing
Fixes#48443.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn moreCopilot coding agent tips in the docs.