Make TypeScript errors prettier and human-readable in VSCode.
TypeScript errors become messier as the complexity of types increases. At some point, TypeScript will throw on you a shitty heap of parentheses and "...".
This extension will help you understand what's going on. For example, in this relatively simple error:
Features
Syntax highlighting with your theme colors for types in error messages, supporting both light and dark themes
A button that leads you to the relevant type declaration next to the type in the error message
A button that navigates you to the error at typescript.tv, where you can find a detailed explanation, sometimes with a video
A button that navigates you to ts-error-translator, where you can read the error in plain English
Supports
Node and Deno TypeScript error reporters (in .ts files)
JSDoc type errors (in .js and .jsx files)
React, Solid and Qwik errors (in .tsx and .mdx files)
Astro, Svelte and Vue files when TypeScript is enabled (in .astro, .svelte and .vue files)
Why isn't it trivial
TypeScript errors contain types that are not valid in TypeScript.
Yes, these types include things like ... more ..., { ... }, etc in an inconsistent manner. Some are also cutting in the middle because they're too long.
Types can't be syntax highlighted in code blocks because the part of type X = ... is missing, so I needed to create a new TextMate grammar, a superset of TypeScript grammar called type.
VSCode markdown blocks all styling options, so I had to find hacks to style the error messages. e.g., there isn't an inlined code block on VSCode markdown, so I used a code block inside a codicon icon, which is the only thing that can be inlined. That's why it can't be copied. but it isn't a problem because you can still hover on the error and copy things from the original error pane.
Contribution
Every contribution is welcome.
Feel free to ask anything and open any issue / PR you desire.
FAQs
Make TypeScript errors prettier and more human-readable in VSCode
The npm package pretty-ts-errors-lsp receives a total of 0 weekly downloads. As such, pretty-ts-errors-lsp popularity was classified as not popular.
We found that pretty-ts-errors-lsp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.
Last updated on 18 Apr 2023
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Researchers have demonstrated that teams of LLM agents can exploit zero-day vulnerabilities with a 53% success rate, and the costs of using AI to do so are rapidly becoming more affordable than hiring a human penetration tester.
In an unprecedented surge, May 2024 saw the publication of over 5,000 CVEs, marking a historic milestone in cybersecurity with an average of 164 CVEs per day, nearly double the 2023 daily average.
The White House is addressing fragmented cybersecurity regulations as CISOs report spending up to 50% of their time on compliance, aiming to harmonize requirements and improve cybersecurity outcomes.