Skip to main content

prettier

Internal library for prettifying files using prettier.

prettify()​

function prettify(content, parser): Promise<undefined | string>

Prettify a string using prettier.format.

Parameters​

content​

string

the string to be prettified.

parser​

string

the prettier parser to use.

Returns​

Promise<undefined | string>

a prettified string, or undefined if an error occurred.

Remarks​

This function logs a warning message on error.

See​

https://prettier.io/docs/en/options#parser for the list of parsers.

Defined in​

prettier.ts:29


prettifyMarkdown()​

function prettifyMarkdown(content): Promise<undefined | string>

Prettify a Markdown string using prettify and markdown parser.

Parameters​

content​

string

the string to be prettified.

Returns​

Promise<undefined | string>

a prettified string, or undefined if an error occurred.

Remarks​

Same as prettify(content, "markdown").

See​

prettify

Defined in​

prettier.ts:61