mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 01:21:58 +00:00
13 lines
298 B
TypeScript
13 lines
298 B
TypeScript
import prettier from 'prettier';
|
|
import parserBabel from 'prettier/parser-babel';
|
|
|
|
export function format(content: string, options = {}) {
|
|
return prettier.format(content, {
|
|
parser: 'babel',
|
|
plugins: [parserBabel],
|
|
singleQuote: true,
|
|
jsxSingleQuote: false,
|
|
...options,
|
|
});
|
|
}
|