Open vdawg-git opened 2 years ago
A small types highlighter is something I've been thinking about for the twoslash hovers in the site ( https://github.com/shikijs/twoslash/pull/159 ) which could perhaps feed two birds with one feeder.
Any updates on this? Especially when working with a lot of generics or simply complex types, the error messages are very hard to read and this change would help a lot
This VS Code plugin came to rescue: https://github.com/yoavbls/pretty-ts-errors?tab=readme-ov-file
Suggestion
Typescript error messages can be a bit verbose sometimes. Color coding them and formatting them better (in reference to #45896) would greatly improve their readabillity.
π Search Terms
Colour code, color code, syntax highlighting, formatter, error messages
β Viability Checklist
My suggestion meets these guidelines:
β Suggestion
A plus: Colour coded visual difference for type errors, for example when unions do not match or a required property is missing.
π Motivating Example
Images speak a thousand lines of code (I messed up the formatting a bit. I did this by hand in an online tool..)
π» Use Cases
Overall useful as current error messages are hard to read, especially with big complex types.