-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
76 lines (66 loc) · 1.73 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
73
74
75
// Dependencies
const coffeelint = require('gulp-coffeelint');
const debug = require('gulp-debug');
const gulp = require('gulp');
const jshint = require('gulp-jshint');
const jsonlint = require('gulp-jsonlint');
const lesshint = require('gulp-lesshint');
const stylish = require('coffeelint-stylish');
// Files
const coffeeFiles = [
'./grammars/*.cson',
'./keymaps/*.cson',
'./lib/**/*.coffee',
'./menus/*.cson',
'./snippets/*.cson'
];
const jsFiles = [
'./lib/**/*.js'
];
const jsonFiles = [
'./grammars/*.json',
'./keymaps/*.json',
'./menus/*.json',
'./snippets/*.json',
'./package.json'
];
const lessFiles = [
'./styles/**/*.less'
];
// Lint CoffeeScript & CSON files
gulp.task('lint:coffee', gulp.series(function(done) {
gulp.src(coffeeFiles)
.pipe(debug({title: 'coffeelint:'}))
.pipe(coffeelint())
.pipe(coffeelint.reporter(stylish))
.pipe(coffeelint.reporter('fail'));
done();
}));
// Lint LESS files
gulp.task('lint:less', gulp.series(function(done) {
gulp.src(lessFiles)
.pipe(debug({title: 'lesshint:'}))
.pipe(lesshint())
.pipe(lesshint.reporter());
done();
}));
// Lint JavaScript files
gulp.task('lint:js', gulp.series(function(done) {
gulp.src(jsFiles)
.pipe(debug({title: 'jshint:'}))
.pipe(jshint());
done();
}));
// Lint JSON files
gulp.task('lint:json', gulp.series(function(done) {
gulp.src(jsonFiles)
.pipe(debug({title: 'jsonlint:'}))
.pipe(jsonlint())
.pipe(jsonlint.failAfterError())
.pipe(jsonlint.reporter());
done();
}));
// Tasks
gulp.task('lint', gulp.parallel('lint:coffee', 'lint:js', 'lint:json', 'lint:less', function(done) {
done();
}));