forked from FormidableLabs/webpack-stats-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
65 lines (59 loc) · 1.88 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/**
* Gulpfile
*/
var gulp = require("gulp");
var eslint = require("gulp-eslint");
var jscs = require("gulp-jscs");
var mdox = require("gulp-mdox");
// ----------------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------------
var JS_FILES = [
"lib/**/*.js",
"demo/*.js",
"*.js"
];
// ----------------------------------------------------------------------------
// EsLint
// ----------------------------------------------------------------------------
gulp.task("eslint", function () {
return gulp
.src(JS_FILES)
.pipe(eslint())
.pipe(eslint.formatEach("stylish", process.stderr))
.pipe(eslint.failOnError());
});
// ----------------------------------------------------------------------------
// JsCs
// ----------------------------------------------------------------------------
gulp.task("jscs", function () {
return gulp
.src(JS_FILES)
.pipe(jscs());
});
// ----------------------------------------------------------------------------
// Quality
// ----------------------------------------------------------------------------
gulp.task("check", ["jscs", "eslint"]);
gulp.task("check:ci", ["jscs", "eslint"]);
gulp.task("check:all", ["jscs", "eslint"]);
// ----------------------------------------------------------------------------
// Docs
// ----------------------------------------------------------------------------
gulp.task("docs", function () {
return gulp
.src([
"lib/**/*.js"
])
.pipe(mdox({
src: "./README.md",
name: "README.md",
start: "## Plugins",
end: "## Contributions"
}))
.pipe(gulp.dest("./"));
});
// ----------------------------------------------------------------------------
// Aggregations
// ----------------------------------------------------------------------------
gulp.task("default", ["check"]);