yoavbls / pretty-ts-errors

🔵 Make TypeScript errors prettier and human-readable in VSCode 🎀
https://marketplace.visualstudio.com/items?itemName=yoavbls.pretty-ts-errors
MIT License
13.44k stars 89 forks source link

Partial support for other languages #110

Open sevenc-nanashi opened 4 months ago

sevenc-nanashi commented 4 months ago

This PR adds support of other languages (only for few errors). Supported:

This PR partially supports: #27.

Status (for backlog) Status: - I created generate-regex.ts - This file should have higher maintainability, so I decided to use TypeScript via tsx (ts-node is complex around esm). - I found it's very difficult, as it's impossible to get a single word corresponds `type`, `type alias`, etc. - I need some ideas against this. - imo it's better than nothing, so I'll consider this pr as partial support. - Supported: - Missing properties error - Overload error
Screenshots ![image](https://github.com/yoavbls/pretty-ts-errors/assets/59691627/a0a0479c-ed27-4907-9f9a-a7db84d0236e) ![image](https://github.com/yoavbls/pretty-ts-errors/assets/59691627/e825aa9f-7995-415e-8f48-900223ec7764) ![image](https://github.com/yoavbls/pretty-ts-errors/assets/59691627/89feb66e-1162-4e04-bf4a-de21fe50ab09) ![image](https://github.com/yoavbls/pretty-ts-errors/assets/59691627/0d2a0929-8f5e-4042-afae-dd9d505426bb) ![image](https://github.com/yoavbls/pretty-ts-errors/assets/59691627/9aa1198d-d3a6-4ffc-b123-88480910f293) ![image](https://github.com/yoavbls/pretty-ts-errors/assets/59691627/47567588-bc32-4949-9f91-7031c89a90b7)
const missingSomeProps: Record<"a" | "b", string> = {}
const missingManyProps: Record<"a" | "b" | "c" | "d" | "e" | "f", string> = {}

type Overload = {
  (arg: string): string
  (arg: number): number
}

const overload: Overload = (arg) => arg

overload(false)