Skip to content

Commit

Permalink
Merge pull request #22 from Arjen-Smit/scss-lint
Browse files Browse the repository at this point in the history
Add sass linter to task
  • Loading branch information
ahoek committed Mar 15, 2016
2 parents 45e801b + 1db46c9 commit 08af19f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
"gulp-plumber": "^1.1.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.2.0",
"gulp-scss-lint": "^0.3.9",
"gulp-simple-task-loader": "^1.0.38",
"gulp-sourcemaps": "^1.6.0",
"gulp-svgmin": "^1.2.2",
"gulp-uglify": "^1.5.3",
"gulp-util": "^3.0.4",
"lodash": "^4.6.1"
"lodash": "^4.6.1",
"shelljs": "^0.6.0"
},
"repository": {
"type": "git",
Expand Down
20 changes: 17 additions & 3 deletions tasks/sass.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
'use strict';

module.exports = function(gulp, config) {

var shelljs = require('shelljs');
var util = require('gulp-util');
if (shelljs.which('scss-lint') !== null) {
var scssLint = require('gulp-scss-lint');
} else {
var scssLint = util.noop;
util.log(util.colors.red("SCSS linting is disabled"),"to enable this feature please install scss_lint '", util.colors.green("gem install scss_lint"), "'");
}

return function() {

/* define required plugins */
var sourcemaps = require('gulp-sourcemaps');
var util = require('gulp-util');
var sass = require('gulp-sass');
var plumber = require('gulp-plumber');
var autoprefixer = require('gulp-autoprefixer');
var gulpif = require('gulp-if');
var gulpIf = require('gulp-if');
var moreCss = require('gulp-more-css');
var livereload = require('gulp-livereload');

Expand All @@ -22,6 +31,11 @@ module.exports = function(gulp, config) {
this.emit('end');
}
}))
.pipe(
scssLint({
'config': '.scss-lint.yml'
})
)
.pipe(sourcemaps.init())
.pipe(sass({
includePaths : config.sass.includePaths
Expand All @@ -32,7 +46,7 @@ module.exports = function(gulp, config) {
remove: true
}))
.pipe(
gulpif(config.production,
gulpIf(config.production,
moreCss({
radical: false
}),
Expand Down

0 comments on commit 08af19f

Please sign in to comment.