gulp-prettier
Format files with Prettier
Last updated a year ago by thomasvantuycom .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install gulp-prettier 
SYNC missed versions from official npm registry.

gulp-prettier

Format files with Prettier

GitHub Workflow Status npm version semantic-release

Install

npm install gulp-prettier --save-dev

Usage

import gulp from 'gulp';
import prettier from 'gulp-prettier';

function format() {
  return gulp.src('src/*.js')
    .pipe(prettier({ singleQuote: true }))
    .pipe(gulp.dest('dist'));
}

export default format;

To check whether or not your files adhere to Prettier's formatting, use prettier.check. This can be used as a validation step in CI scenarios.

import gulp from 'gulp';
import prettier from 'gulp-prettier';

function validate() {
  return gulp.src('dist/*.js')
    .pipe(prettier.check({ singleQuote: true }));
}

export default validate;

API

prettier([options])

Formats your files using Prettier.

options

Type: Object

Consult the Prettier options.

editorconfig: true can also be passed to enable EditorConfig support.

prettier.check([options])

Checks if your files have been formatted with Prettier and, if not, throws an error with a list of unformatted files. This is useful for running Prettier in CI scenarios.

options

Type: Object

Consult the Prettier options.

editorconfig: true can also be passed to enable EditorConfig support.

License

MIT © Thomas Vantuycom

Current Tags

  • 6.0.0                                ...           latest (a year ago)

10 Versions

  • 6.0.0                                ...           a year ago
  • 5.0.0                                ...           a year ago
  • 4.0.0                                ...           3 years ago
  • 3.0.0                                ...           5 years ago
  • 2.3.0                                ...           5 years ago
  • 2.2.0                                ...           5 years ago
  • 2.1.0                                ...           6 years ago
  • 2.0.0                                ...           7 years ago
  • 1.1.0                                ...           8 years ago
  • 1.0.0                                ...           8 years ago
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (7)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE