@emdaer/transform-prettier

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

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@emdaer/transform-prettier
14333.2.312 years ago5 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