gulp-pretty
v1.0.1
Published
Vinyl pipes for Prettier.
Downloads
15
Readme
gulp-pretty
Source code formatting using prettier
Install
$ npm install --save-dev gulp-pretty
Usage
const gulp = require('gulp');
const pretty = require('gulp-pretty');
// prettier can be called by itself...
gulp.task('format', () =>
gulp
.src('src/**/*.js')
.pipe(pretty())
.pipe(gulp.dest('src/'))
);
// ...or with options.
gulp.task('format-with-options', () =>
gulp
.src('src/**/*.js')
.pipe(
pretty({
singleQuote: true,
trailingComma: 'es5',
})
)
.pipe(gulp.dest('src/'))
);