-
Notifications
You must be signed in to change notification settings - Fork 12.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 our terms of service and privacy 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?
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.
Run npx 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 output then issue diagnostics and exit.
Run npx 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 commit f1c7d72. |
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.
Run npx 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 |
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 more Copilot coding agent tips in the docs.