Add "lint" gulp command with sass linting.

This commit is contained in:
Christopher Charbonneau Wells 2017-08-22 13:13:23 -04:00
parent 0f079c14fa
commit 0c5c3b7a2c
2 changed files with 27 additions and 0 deletions

26
gulpfile.js/tasks/lint.js Normal file
View File

@ -0,0 +1,26 @@
var gulp = require('gulp');
var sassLint = require('gulp-sass-lint');
var pump = require('pump');
var watchConfig = require('../config.js').watchConfig;
gulp.task('lint', ['lint:styles']);
gulp.task('lint:styles', function(cb) {
pump([
gulp.src(watchConfig.stylesGlob),
sassLint({
rules: {
'declarations-before-nesting': 1,
'indentation': [ 1, { 'size': 4 } ],
'no-ids': 0,
'no-vendor-prefixes': 2,
'property-sort-order': 0
}
}),
sassLint.format(),
sassLint.failOnError()
], cb);
});

View File

@ -10,6 +10,7 @@
"gulp-csso": "^3.0.0",
"gulp-sass": "^3.1.0",
"gulp-sass-glob": "^1.0.8",
"gulp-sass-lint": "^1.3.2",
"gulp-uglify": "^3.0.0",
"jquery": "^3.2.1",
"moment": "^2.18.1",