Dprint wrapper to programmatically format source files in memory.
This project is meant for internal use in the node-zwave-js
project.
yarn add --dev @dprint/formatter @dprint/json @dprint/markdown @dprint/typescript @zwave-js/fmt
import { formatWithDprint } from "@zwave-js/fmt";
const formatted = formatWithDprint(
"/path/to/repo/root",
"/path/to/repo/root/path/to/file.ts",
"const foo = 1 "
)
console.log(formatted);
// prints:
// const foo = 1;