-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
executable file
·44 lines (36 loc) · 1.11 KB
/
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
43
44
var gulp = require("gulp");
var watch = require("gulp-watch");
var beautify = require("gulp-beautify");
var eslint = require('gulp-eslint');
gulp.task("lint", function(){
return gulp.src("lib/**/*.js")
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task("spec-lint", function(){
return gulp.src("spec/*.js")
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError())
.pipe(beautify({indent_size:4, indent_with_tabs:true}))
.pipe(gulp.dest('./spec/'));
});
gulp.task("pretty-code", function(){
return gulp.src("lib/**/*.js")
.pipe(beautify({indent_size:4, indent_with_tabs:true}))
.pipe(gulp.dest("./lib/"));
});
gulp.task("pretty-bin", function(){
return gulp.src("bin/*.js")
.pipe(beautify({indent_size:4, indent_with_tabs:true}))
.pipe(gulp.dest("./bin/"));
});
gulp.task("lint-easy", function(){
return gulp.src("src/*.js")
.pipe(eslint())
.pipe(eslint.format());
});
gulp.task("watch", function(){
return gulp.watch("lib/**/*.js", {ignoreInitial: false}, ["lint-easy"]);
});