@pretty-ts-errors/formatter
TypeScript icon, indicating that this package has built-in type declarations

0.1.7 • Public • Published

Pretty TypeScript Error formatter

The formatting package of pretty-ts-errors

Usage

import { formatDiagnosticMessage } from "@pretty-ts-errors/formatter";

function codeBlock(code: string, language?: string, multiLine?: boolean) {
  return `\`\`\`${language}
${code}
\`\`\`
`;
}

formatDiagnosticMessage(
  `Type 'string' is not assignable to type 'number'.`,
  codeBlock
);

Readme

Keywords

Package Sidebar

Install

npm i @pretty-ts-errors/formatter

Weekly Downloads

2

Version

0.1.7

License

MIT

Unpacked Size

21.5 kB

Total Files

9

Last publish

Collaborators

  • yoavbls