Implement enhanced CLI error formatting#62130
Closed
anivar wants to merge 5 commits intomicrosoft:mainfrom
Closed
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
Contributor
There was a problem hiding this comment.
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
Author
|
@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 |
Author
|
Closing this PR in favor of a much simpler approach. The original implementation was over-engineered with complex terminal detection and Unicode characters. Creating a new PR with a minimal solution:
Thanks for the feedback on complexity! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 #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