Pretty TypeScript Errors Formatter
npm install @pretty-ts-errors/formattertypescript
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
);``