diff --git a/gulpfile.js/tasks/lint.js b/gulpfile.js/tasks/lint.js new file mode 100644 index 00000000..445fbddb --- /dev/null +++ b/gulpfile.js/tasks/lint.js @@ -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); +}); diff --git a/package.json b/package.json index 7a767e43..d8b2bba0 100644 --- a/package.json +++ b/package.json @@ -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",