@imhele/gulp-prettier
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

gulp-prettier GitHub Workflow Status npm version semantic-release

Format files with Prettier

Install

npm install gulp-prettier --save-dev

Usage

const { src, dest } = require('gulp');
const prettier = require('gulp-prettier');

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

exports.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.

const { src, dest } = require('gulp');
const prettier = require('gulp-prettier');

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

exports.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 © Bhargav R. Patel, Thomas Vantuycom

Package Sidebar

Install

npm i @imhele/gulp-prettier

Weekly Downloads

1

Version

3.0.0

License

MIT

Unpacked Size

9.76 kB

Total Files

6

Last publish

Collaborators

  • imhele