prettify = (text, fileExtension = 'js', options = {}) => {
  const parser = getPrettierParser(fileExtension);
  const textToFormat = parser === 'html' ? removeEmptyLines(text) : text;
  /** @type PrettierOptions */
  const prettierOptions = {
    parser,
    printWidth: 100,
    singleQuote: true,
    ...options,
  };
  return prettier.format(textToFormat, prettierOptions);
}
Prettifies text using the prettier.
- Supported file extensions are: js | cjs | mjs | md | html | json | css | yaml | yml
@example
  await prettify('some js code');
  await prettify('<html>some html</html>', 'html');
  await prettify('some-markdown', 'md', {printWidth: 120});
@param {string} text
@param {string} fileExtension ['js']
@param {PrettierOptions} [options] [{ printWidth = 100, singleQuote = true }]
@see {@link https://prettier.io/docs/en/options.html}
@returns {Promise<string>}
@throws ERROR_UNSUPPORTED_FILE_EXTENSION