resume/bun/fmt.js

16 lines
518 B
JavaScript
Raw Permalink Normal View History

2024-01-08 23:09:06 +00:00
/** @type {(parser: string, ps: string[]) => import("bun").Subprocess} */
const prettier = (parser, ps) =>
Bun.spawn(['bun', 'x', 'prettier', '--write', '--parser', parser, ...ps], {
stdout: 'inherit',
stderr: 'inherit',
})
const procs = [
prettier('babel', ['./index.js', './bun/**/*.js', './.prettierrc.cjs']),
prettier('json', ['./package.json', './jsconfig.json']),
prettier('html', ['./resume.html']),
prettier('css', ['./assets/iosevka.css']),
]
await Promise.all(procs.map(p => p.exited))