astro/test/test-utils.js
Kevin (Kun) "Kassimo" Qian 5eb232501f
Allow multiple JSX children appear in Mustache tag (#125)
* fix(www): link styles (#100)

Co-authored-by: Nate Moore <nate@skypack.dev>

* Add `assets/` (#102)

* chore: add assets

* docs: update readme

Co-authored-by: Nate Moore <nate@skypack.dev>

* docs: fix readme

* docs: fix readme

* chore: remove github banner

* Allow multiple JSX in mustache

* Manually discard package-lock update (due to local use of npm v7)

* Tidy up

* Revert mode ts-ignore

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Nate Moore <nate@skypack.dev>
2021-04-22 15:10:06 -04:00

18 lines
439 B
JavaScript

import cheerio from 'cheerio';
import prettier from 'prettier';
import { fileURLToPath } from 'url';
/** load html */
export function doc(html) {
return cheerio.load(html);
}
/**
* format the contents of an astro file
* @param contents {string}
*/
export function format(contents) {
return prettier.format(contents, {
parser: 'astro',
plugins: [fileURLToPath(new URL('../prettier-plugin-astro', import.meta.url))],
});
}