forked from kotarou3/Krister-Pokemon-Showdown
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
77 lines (66 loc) · 1.85 KB
/
gulpfile.js
File metadata and controls
77 lines (66 loc) · 1.85 KB
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
73
74
75
76
77
var gulp = require('gulp');
var jshintStylish = require('jshint-stylish');
var gutil = require('gulp-util'); // Currently unused, but gulp strongly suggested I install...
var jshint = require('gulp-jshint');
var replace = require('gulp-replace');
var jsHintOptions = {
"nonbsp": true,
"noarg": true,
"loopfunc": true,
"latedef": 'nofunc',
"freeze": true,
"immed": true,
"undef": true,
// style
// "indent": true,
"smarttabs": true,
"trailing": true,
"newcap": true,
"sub": true,
"evil": true,
"esnext": true,
"node": true,
"eqeqeq": false,
"globals": {
"Config": false,
"ResourceMonitor": false,
"toId": false,
"toName": false,
"string": false,
"LoginServer": false,
"Users": false,
"Rooms": false,
"Verifier": false,
"CommandParser": false,
"Simulator": false,
"Tournaments": false,
"Dnsbl": false,
"Cidr": false,
"Sockets": false,
"Tools": false,
"TeamValidator": false,
"battleEngineFakeProcess": false,
"battleProtoCache": false,
"reloadCustomAvatars": false
}
};
gulp.task('lint', function () {
var directories = ['./*.js', './data/*.js', './mods/*/*.js', './tournaments/*.js', './chat-plugins/*.js', './config/*.js'];
// Replacing `var` with `let` is sort of a hack that stops jsHint from
// complaining that I'm using `var` like `let` should be used, but
// without having to deal with iffy `let` support.
return gulp.src(directories)
.pipe(replace(/\bvar\b/g, 'let'))
.pipe(jshint(jsHintOptions))
.pipe(jshint.reporter(jshintStylish))
.pipe(jshint.reporter('fail'));
});
gulp.task('fastlint', function () {
var directories = ['./*.js', './tournaments/*.js', './chat-plugins/*.js', './config/*.js'];
return gulp.src(directories)
.pipe(replace(/\bvar\b/g, 'let'))
.pipe(jshint(jsHintOptions))
.pipe(jshint.reporter(jshintStylish))
.pipe(jshint.reporter('fail'));
});
gulp.task('default', ['lint']);