-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
33 lines (29 loc) · 1012 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
'use strict';
var gulp = require('gulp'),
argv = require('yargs').argv,
shell = require('shelljs'),
gutil = require('gulp-util'),
mocha = require('gulp-mocha'),
filter = require('gulp-filter'),
header = require('gulp-header'),
eslint = require('gulp-eslint'),
beautify = require('gulp-jsbeautifier'),
_ = require('lodash');
// Task: lint-and-beautify
// Performs in-place linting & beautification of the *src* files. We perform
// this in-place so that the checked in code is clean and consistent.
gulp.task('lint-and-beautify', function () {
// Beautify Config: src/.jsbeautifyrc
// Linting Config: src/.estlintrc
return gulp
.src(['**/*.js', '!node_modules/**/*.js', '!coverage/**/*'])
.pipe(beautify({
config: '.jsbeautifyrc',
mode: argv['fail-on-beautify'] ? 'VERIFY_ONLY' : 'VERIFY_AND_WRITE'
}))
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError())
.pipe(gulp.dest('.'));
});
gulp.task('default', ['lint-and-beautify']);