Laplacenoma is a reactivity analyzer built on top of the TypeScript language service, inspired by the reactivity visualization feature in vuejs/language-tools. Its goal is to provide framework-agnostic and configurable reactivity analysis.
pnpm i laplacenomaimport { createAnalyzer } from "laplacenoma";
import rulesVue from "laplacenoma/rules/vue";
import type ts from "typescript";
const analyzer = createAnalyzer({
rules: rulesVue,
});
export function getReactivityAnalysis(
ts: typeof import("typescript"),
languageService: ts.LanguageService,
fileName: string,
position: number,
) {
const program = languageService.getProgram()!;
const sourceFile = program.getSourceFile(fileName)!;
return analyzer.analyze(sourceFile, position, {
typescript: ts,
languageService,
});
}