Skip to content

Latest commit

 

History

History
115 lines (61 loc) · 1.99 KB

prettier.md

File metadata and controls

115 lines (61 loc) · 1.99 KB

prettier

Internal library for prettifying files using prettier.

Functions

prettify()

Internal

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.

Source

prettier.ts:29


prettifyJavascript()

Internal

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

Prettify a Javascript string using prettify and babel 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, "babel").

See

prettify

Source

prettier.ts:82


prettifyMarkdown()

Internal

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

Source

prettier.ts:61