-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgulpfile.js
30 lines (27 loc) · 890 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
'use strict';
let gulp = require('gulp');
let nodemon = require('gulp-nodemon');
let eslint = require('gulp-eslint');
gulp.task('nodemon', function () {
nodemon({
script: 'app.js',
env: {PORT: 3000}
}).on('restart');
});
gulp.task('lint', function () {
return gulp.src([
'./controllers/*.js',
'./middlewares/*.js',
'./models/*.js',
'./test/*.js',
'./tools/*.js',
'./*.js'
]).pipe(eslint()).pipe(eslint.format()).pipe(eslint.failOnError());
// eslint() attaches the lint output to the eslint property
// of the file object so it can be used by other modules.
// eslint.format() outputs the lint results to the console.
// Alternatively use eslint.formatEach() (see Docs).
// To have the process exit with an error code (1) on
// lint error, return the stream and pipe to failOnError last.
});
gulp.task('default', ['lint', 'nodemon']);