forked from RanvierMUD/ranviermud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
72 lines (61 loc) · 1.39 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
66
67
68
69
70
71
72
var gulp = require('gulp');
var todo = require('gulp-todo');
var lint = require('gulp-eslint');
var paths = {
src: './',
spec: './spec/*.js',
js: [
'./*.js',
'./src/*.js',
'./src/**/*.js',
'./bundles/**/*.js',
'!./**/node_modules/**'],
};
const report = {
ignore: 0,
warn: 1,
error: 2,
};
var options = {
todo: {
absolute: true,
fileName: 'gulpTODO.md'
},
lint: {
rules: {
'no-reserved-keys': report.ignore,
'no-cond-assign': report.warn,
'no-dupe-args': report.warn,
'no-dupe-keys': report.warn,
'no-duplicate-case': report.warn,
'no-extra-semi': report.warn,
'no-func-assign': report.warn,
'no-sparse-arrays': report.warn,
'yoda': report.warn,
'camelcase': report.warn,
'use-isnan': report.error,
'valid-typeof': report.error,
'no-unreachable': report.error,
'no-undef': report.error,
},
parserOptions: {
'ecmaVersion': 6,
},
}
};
gulp.task('todo', toDoTask);
gulp.task('lint', lintTask);
gulp.task('default', ['todo', 'lint']);
function lintTask() {
return gulp
.src(paths.js)
.pipe(lint(options.lint))
.pipe(lint.format())
.pipe(lint.failAfterError());
}
function toDoTask() {
return gulp
.src(paths.js)
.pipe(todo(options.todo))
.pipe(gulp.dest(paths.src));
}