Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

330 B
Raw Blame
import type { Linter } from 'harper.js';

export async function createEditorLinter(): Promise<Linter> {
	const [{ WorkerLinter }, { slimBinary }] = await Promise.all([
		import('harper.js'),
		import('harper.js/slimBinary'),
	]);

	const linter = new WorkerLinter({ binary: slimBinary });
	await linter.setup();
	return linter;
}