explaingit

yoavbls/pretty-ts-errors

14,083TypeScriptAudience · developerComplexity · 1/5Setup · easy

TLDR

A VSCode extension that reformats hard-to-read TypeScript error messages with syntax highlighting, clickable type links, and plain-English translations shown directly in the editor.

Mindmap

mindmap
  root((pretty-ts-errors))
    What it does
      Reformats TS errors
      Syntax highlighting
      Clickable links
    Links added
      Type declaration jump
      typescript.tv
      ts-error-translator
    Supported frameworks
      React Solid Svelte
      Vue Astro Qwik
      Ember Glimmer
    Setup
      VSCode marketplace
      One command install
    Audience
      TypeScript developers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Read complex TypeScript generic type errors at a glance without decoding a wall of nested text.

USE CASE 2

Jump from an error message directly to the type declaration in your codebase with one click.

USE CASE 3

Open an error on ts-error-translator or typescript.tv to see a plain-English rewrite or video explanation.

USE CASE 4

Use in React, Svelte, Vue, Astro, or Solid projects to get formatted errors for framework-specific type issues.

Tech stack

TypeScript

Getting it running

Difficulty · easy Time to first run · 5min
No license information is mentioned in the explanation.

In plain English

TypeScript is a programming language that adds strict type rules to JavaScript. When those rules are violated, the code editor shows an error message. As projects grow more complex, those error messages can become very long and hard to read, packed with nested type names, ellipses, and technical notation that is difficult to follow at a glance. Pretty TypeScript Errors is a VSCode extension that reformats those error messages to make them easier to understand. It applies syntax highlighting to type names inside error messages using your existing editor color theme, so individual types stand out visually instead of blending into a wall of text. It also adds links directly inside the error panel: one link jumps to the relevant type declaration in your codebase, a second opens the error on typescript.tv where written explanations are available, and a third opens the error on a site called ts-error-translator that shows the message rewritten in plain English. The extension works with TypeScript files but also covers JSDoc type errors in plain JavaScript files, and frameworks like React, Solid, Qwik, Astro, Svelte, and Vue when TypeScript is enabled. Ember and Glimmer template errors are supported too. Installation is one command in the terminal or a search in the VSCode marketplace. The extension won a productivity award at JSNation 2023 and has been covered in several developer video channels. The README explains some of the technical challenges involved, including the need to create a custom grammar for syntax highlighting since TypeScript error messages contain types that are not valid TypeScript on their own.

Copy-paste prompts

Prompt 1
I have a TypeScript error with deeply nested generics that is nearly unreadable. After installing pretty-ts-errors, walk me through what the highlighted output looks like and how to read the colored type parts.
Prompt 2
I'm setting up pretty-ts-errors in a Svelte and TypeScript project. Walk me through installing it from the VSCode marketplace and verifying it works on a component with a type mismatch.
Prompt 3
My TypeScript project uses complex utility types and the error messages are walls of text. Show me how to install pretty-ts-errors and use the ts-error-translator link it adds to understand the error in plain English.
Prompt 4
Explain how pretty-ts-errors creates syntax highlighting for TypeScript error messages when the error text is not valid TypeScript, based on the README's description of the custom grammar approach.
Prompt 5
I want to contribute to pretty-ts-errors. What part of the codebase would handle adding a new link target inside error messages, alongside the existing typescript.tv and ts-error-translator links?
Open on GitHub → Explain another repo

← yoavbls on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.