-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Implement enhanced CLI error formatting #62130
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
- Add visual bullet points (●) for each diagnostic - Move error codes (TS####) to the right and de-emphasize with grey - Replace tilde (~) underlines with overlines (▔) - Add vertical bars (|) for better code snippet framing - Terminal width detection with 60+ column requirement - Fallback to original formatting for narrow terminals - Full backwards compatibility maintained
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.
Pull Request Overview
This PR implements enhanced CLI error formatting for TypeScript compiler diagnostics to improve readability and visual structure. The changes introduce a more modern error display format with visual markers, cleaner code presentation, and improved terminal compatibility detection.
Key Changes
- Replaces traditional tilde underlines with overlines and adds visual bullet points for error markers
- Implements terminal width detection to determine when to use enhanced formatting (minimum 60 columns)
- Maintains full backwards compatibility by falling back to original formatting for narrow terminals
- Fix length parameter with proper default value handling - Add proper bounds checking for overline calculation - Simplify terminal detection with explicit checks for limited terminals - Handle multi-line errors gracefully by showing only first line - Add CI environment detection with opt-in support - Respect NO_COLOR environment variable
@microsoft-github-policy-service agree company="Foodhub" |
- Fix trailing commas in function parameters - Fix quote consistency (single quotes to double quotes) - Fix empty line spacing according to dprint style guide
🤖 AI Assistant: Task completed: PR #62130: Implement enhanced CLI error formatting |
Fixes #45717
Summary
This PR implements the enhanced error formatting proposed in #45717, improving the readability and visual structure of TypeScript compiler error messages.
Changes
Before:
After:
Implementation Details
Testing
Notes