gulp-polish
Advanced tools
Comparing version 2.4.1 to 2.4.2
@@ -24,3 +24,3 @@ var through = require('through2'); | ||
if (!file.isBuffer()) { | ||
if (!file.isBuffer() || file.contents.toString('utf8').length === 0) { | ||
return cb(null, file); | ||
@@ -30,3 +30,3 @@ } | ||
polish(file, rules); | ||
return cb(null, file); | ||
@@ -33,0 +33,0 @@ }); |
@@ -29,3 +29,3 @@ var through = require('through2'), | ||
_.each(fileErrors, function (error){ | ||
var message; | ||
var message; | ||
@@ -63,3 +63,3 @@ if (_.isFunction(error.rule.message)) { | ||
output += table([ | ||
output += table([ | ||
[ | ||
@@ -70,3 +70,3 @@ chalk.gray('line ' + error.data.rule.start.line), | ||
chalk.red(message) | ||
] | ||
] | ||
]); | ||
@@ -92,3 +92,3 @@ | ||
return through.obj(function (file, enc, cb) { | ||
if (!file.isBuffer()) { | ||
if (!file.isBuffer() || file.contents.toString('utf8').length === 0) { | ||
return cb(null, file); | ||
@@ -95,0 +95,0 @@ } |
@@ -5,3 +5,3 @@ var fs = require('fs'); | ||
module.exports = function(file, rules){ | ||
module.exports = function getConfig (file, rules){ | ||
var configDir = path.join(file.path.replace(process.cwd(),''), '../'), | ||
@@ -46,2 +46,2 @@ filename = path.basename(file.relative, path.extname(file.relative)), | ||
return config; | ||
}; | ||
}; |
@@ -45,5 +45,5 @@ var fs = require('fs'); | ||
module.exports = function(file, syntax){ | ||
module.exports = function processStylesheet (file, syntax){ | ||
var filetype = path.extname(file.path).replace('.','').toLowerCase(), | ||
ast; | ||
output; | ||
@@ -54,3 +54,3 @@ if (!_.contains(['css','scss','sass','less'], filetype)){ | ||
ast = { | ||
output = { | ||
name: path.basename(file.path).split('.')[0], | ||
@@ -60,7 +60,7 @@ cssDOM: gonzales.parse(file.contents.toString('utf8'), { syntax: filetype }) | ||
ast.cssDOM.traverseByTypes(['multilineComment', 'singlelineComment'], function (comment, index, level, parent){ | ||
output.cssDOM.traverseByTypes(['multilineComment', 'singlelineComment'], function (comment, index, level, parent){ | ||
readComment(comment, level); | ||
}); | ||
return ast; | ||
return output; | ||
}; |
@@ -37,3 +37,3 @@ var _ = require('lodash'); | ||
return errors; | ||
return errors || []; | ||
}; |
@@ -1,4 +0,4 @@ | ||
var getConfig = require('./polish-get-config'); | ||
var testFile = require('./polish-test-file'); | ||
var processCSS = require('./polish-process-stylesheet'); | ||
var getConfig = require('./polish-get-config'), | ||
testFile = require('./polish-test-file'), | ||
processStylesheet = require('./polish-process-stylesheet'); | ||
@@ -11,5 +11,5 @@ module.exports = function(file, rules){ | ||
var config = getConfig(file, rules), | ||
processedCSS = processCSS(file), | ||
testResults = testFile(file, processedCSS, rules, config); | ||
var config = getConfig(file, rules), | ||
processedStyles = processStylesheet(file), | ||
testResults = testFile(file, processedStyles, rules, config); | ||
@@ -16,0 +16,0 @@ file.polish = {}; |
{ | ||
"name": "gulp-polish", | ||
"version": "2.4.1", | ||
"version": "2.4.2", | ||
"description": "Make your stylesheets perfect. Add an extra coat of polish.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18374
283