Internal library for prettifying files using prettier
.
Internal
function prettify(content, parser): Promise<undefined | string>
Prettify a string using prettier.format.
• content: string
the string to be prettified.
• parser: string
the prettier
parser to use.
Promise
<undefined
| string
>
a prettified string, or undefined if an error occurred.
This function logs a warning message on error.
https://prettier.io/docs/en/options#parser for the list of parsers.
Internal
function prettifyJavascript(content): Promise<undefined | string>
Prettify a Javascript string using prettify and babel
parser.
• content: string
the string to be prettified.
Promise
<undefined
| string
>
a prettified string, or undefined if an error occurred.
Same as prettify(content, "babel")
.
Internal
function prettifyMarkdown(content): Promise<undefined | string>
Prettify a Markdown string using prettify and markdown
parser.
• content: string
the string to be prettified.
Promise
<undefined
| string
>
a prettified string, or undefined if an error occurred.
Same as prettify(content, "markdown")
.