Skip to main content

prettier

Internal library for prettifying files using prettier.

prettify()

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

Defined in: prettier.ts:29

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.


prettifyMarkdown()

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

Defined in: prettier.ts:61

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