Skip to content

brodybits/prettier-plugin-x-babel

Repository files navigation

prettier-plugin-x-babel

LICENSE npm package

A fork of prettier-plugin-x which uses Babel and prettierX by default for ES languages JavaScript, Flow, and TypeScript, all in a Prettier plugin.

Includes options from prettierX for improved parity with "Standard JS", for example:

function * a () {}

console.log(typeof a)

with the following .prettierrc configuration:

{
  semi: false,
  generatorStarSpacing: true,
  spaceBeforeFunctionParen: true
}

Installation

with Yarn (recommended):

yarn add --dev prettier-plugin-x-babel

or with npm:

npm install --save-dev prettier-plugin-x-babel

Sample usage

prettier --config ./sample-prettierx-prettierrc --check sample.js

to specify TypeScript via babel-ts parser:

prettier --config ./sample-prettierx-prettierrc --parser=typescript --check sample.js

or:

prettier --config ./sample-prettierx-prettierrc --parser=babel-ts --check sample.js

to specify Flow via babel-flow parser:

prettier --config ./sample-prettierx-prettierrc --parser=flow --check sample.js

or:

prettier --config ./sample-prettierx-prettierrc --parser=babel-flow --check sample.js

Thanks and credits

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published