Skip to main content
function Deno.formatDiagnostics
Unstable

UNSTABLE: new API, yet to be vetted.

Format an array of diagnostic items and return them as a single string in a user friendly format. If there are no diagnostics then it will return an empty string.

const { diagnostics } = await Deno.emit("file_with_compile_issues.ts");
console.table(diagnostics);  // Prints raw diagnostic data
console.log(Deno.formatDiagnostics(diagnostics));  // User friendly output of diagnostics
console.log(Deno.formatDiagnostics([]));  // An empty string

Parameters

diagnostics: Diagnostic[]

An array of diagnostic items to format

Returns

string