pretty-ts-errors icon indicating copy to clipboard operation
pretty-ts-errors copied to clipboard

Partial support for other languages

Open sevenc-nanashi opened this issue 8 months ago • 0 comments

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

  • Missing properties error
  • Overload error

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 image

image image

image image

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)

sevenc-nanashi avatar Jun 03 '24 00:06 sevenc-nanashi