0.0.14 • Published 7 months ago

pretty-ts-errors-markdown v0.0.14

Weekly downloads
-
License
-
Repository
-
Last release
7 months ago

pretty-ts-errors-markdown

A fork of https://github.com/yoavbls/pretty-ts-errors. It transforms TypeScript errors into markdown.

https://github.com/hexh250786313/pretty-ts-errors-markdown/assets/26080416/e22dfcd6-2ca6-46e9-9abd-cce1cc56e63a

Install

※ Global

npm i -g pretty-ts-errors-markdown

※ Local

npm i pretty-ts-errors-markdown

Usage (CLI)

※ Use inline parameters

pretty-ts-errors-markdown -i "{\"range\":{\"start\":{\"line\":6,\"character\":6},\"end\":{\"line\":6,\"character\":7}},\"message\":\"Variable 'a' implicitly has an 'any' type.\",\"code\":7005,\"severity\":1,\"source\":\"tsserver\"}"

※ Use standard input

git clone https://github.com/hexh250786313/pretty-ts-errors-markdown && cd pretty-ts-errors-markdown
cat ./examples/input.txt | pretty-ts-errors-markdown > ./examples/output.md

Usage (Programmatically)

import { formatDiagnostic } from "pretty-ts-errors-markdown";
import { Diagnostic } from "vscode-languageserver-types";

const diagnostic: Diagnostic = {
  range: {
    start: { line: 6, character: 6 },
    end: { line: 6, character: 7 },
  },
  message: "Variable 'a' implicitly has an 'any' type.",
  code: 7005,
  severity: 1,
  source: "tsserver",
};

const marked = formatDiagnostic(diagnostic);
console.log(marked);

Credits

Awesome thanks to yoavbls and other contributors for the original pretty-ts-errors

0.0.14

7 months ago

0.0.13

9 months ago

0.0.10

12 months ago

0.0.11

12 months ago

0.0.12

11 months ago

0.0.8-dev.1

1 year ago

0.0.8-dev.0

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago