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
);