@emdaer/transform-prettier

An emdaer transformation that formats markdown, including code blocks, using prettier

Stats

StarsIssuesVersionUpdatedCreatedSize
@emdaer/transform-prettier
14293.2.31a year ago4 years agoMinified + gzip package size for @emdaer/transform-prettier in KB

Readme

@emdaer/transform-prettier ยท Travis Documented with emdaer Maintained with lerna

An emdaer transformation that formats markdown, including code blocks, using prettier

Usage

@emdaer/transform-prettier is an emdaer transform โ€“ see the emdaer monorepo for more information

Documentation

Example

  ()  =>{
  const sayHi = console.log( 'hello world')
    return "0"
  }

is transformed into

() => {
  const sayHi = console.log('hello world');
  return '0';
};

Usage in README

<!--emdaer-t
  - '@emdaer/transform-prettier'
  - options:
      config: ./prettier.config.js
-->

prettierTransform

Transform a string using prettier.

Parameters

  • content string The content
  • options Object Transform options (optional, default {options:{parser:PARSER}})
    • options.options Object Prettier options
      • options.options.config string The path to the Prettier config file. Overrides other Prettier options provided.

Examples

<!--emdaer-t
  - '@emdaer/transform-prettier'
  - options:
      config: ./prettier.config.js
-->

Returns Promise<string> The content formatted by Prettier

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.