/
gulpfile.js
42 lines (32 loc) · 838 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
34
35
36
37
38
39
40
41
42
'use strict';
(() => {
let gulp = require('gulp'),
jshint = require('gulp-jshint'),
stylish = require('jshint-stylish');
let paths = {
js: {
src : [
'index.js',
'lib/**/*.js',
'test/**/*.js',
'examples/**/*.js'
],
},
};
/**
* jshint
*/
gulp.task('js:lint', () => {
let task = gulp.src(paths.js.src)
.pipe(jshint())
.pipe(jshint.reporter(stylish));
if (process.env.CI) {
task = task.pipe(jshint.reporter('fail'));
}
return task;
});
gulp.task('js:watch', () => {
gulp.watch(paths.js.src, ['js:lint']);
});
gulp.task('default', ['js:lint', 'js:watch']);
})();