forked from oddbird/true
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
45 lines (39 loc) · 969 Bytes
/
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
/* eslint-env node */
'use strict';
var beeper = require('beeper');
var chalk = require('chalk');
var gulp = require('gulp');
var log = require('fancy-log');
var sasslint = require('gulp-sass-lint');
var paths = {
TEST_DIR: 'test/',
SASS_DIR: 'sass/',
IGNORE: ['!**/.#*', '!**/flycheck_*'],
init: function() {
this.SASS = [this.SASS_DIR + '**/*.scss'].concat(this.IGNORE);
this.ALL_SASS = [
this.SASS_DIR + '**/*.scss',
this.TEST_DIR + '**/*.scss',
].concat(this.IGNORE);
return this;
},
}.init();
var onError = function(err) {
log.error(chalk.red(err.message));
beeper();
this.emit('end');
};
var sasslintTask = function(src, failOnError) {
var stream = gulp
.src(src)
.pipe(sasslint())
.pipe(sasslint.format())
.pipe(sasslint.failOnError());
if (!failOnError) {
stream.on('error', onError);
}
return stream;
};
gulp.task('sasslint', function() {
return sasslintTask(paths.ALL_SASS);
});