-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
37 lines (30 loc) · 721 Bytes
/
Copy pathgulpfile.js
File metadata and controls
37 lines (30 loc) · 721 Bytes
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
'use strict';
/* eslint-env node */
const gulp = require('gulp');
const eslint = require('gulp-eslint');
const jshint = require('gulp-jshint');
const lintable = [
// 'public/*/*.js',
'server.js',
'server-lib.js'
];
gulp.task('default', ['lint']);
gulp.task('lint', ['eslint', 'jshint', 'watch']);
gulp.task('eslint', () =>
gulp
.src(lintable)
.pipe(eslint())
.pipe(eslint.format())
.on('error', (error) => {
console.error(error.toString()); // eslint-disable-line no-console
this.emit('end');
})
);
gulp.task('jshint', () => gulp
.src(lintable)
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
);
gulp.task('watch', () => {
gulp.watch(lintable, ['jshint', 'eslint']);
});