1
0
silverbullet/web/cm_plugins/lint.ts

12 lines
343 B
TypeScript

import { Diagnostic, linter } from "@codemirror/lint";
import type { Client } from "../client.ts";
export function plugLinter(client: Client) {
return linter(async (): Promise<Diagnostic[]> => {
const results = (await client.dispatchAppEvent("editor:lint", {
name: client.currentPage!,
})).flat();
return results;
});
}