csslint-loader
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -43,4 +43,8 @@ // Dependencies | ||
if (output.errors || (options.failOnWarning == true && output.warnings)) { | ||
if (output.errors || (options.failWarning == true && output.warnings)) { | ||
webpack.emitError(output.message); | ||
if (options.failOnError) { | ||
throw new Error("Module failed because of a csslint error."); | ||
} | ||
} else if (output.warnings) { | ||
@@ -66,3 +70,4 @@ webpack.emitWarning(output.message); | ||
configFile: './.csslintrc', | ||
failOnWarning: true | ||
failOnError: true, | ||
failWarning: true | ||
}, | ||
@@ -69,0 +74,0 @@ loaderUtils.parseQuery(this.query) |
@@ -6,14 +6,2 @@ 'use strict'; | ||
/** | ||
* Checking and parsing config file | ||
* | ||
* @param {Buffer} file lint config file | ||
* @return {Object} JSON parsed config file | ||
*/ | ||
function checkJSON(file) { | ||
return rules; | ||
} | ||
module.exports = function(options) { | ||
@@ -20,0 +8,0 @@ try { |
{ | ||
"name": "csslint-loader", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "CSSLint loader for Webpack", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -34,6 +34,6 @@ # csslintloader for [webpack](http://webpack.github.io/) | ||
You can pass the following options as a query string | ||
You can pass the following options as a query string | ||
- configFile (default: looks for `.csslintrc` in your root directory.) | ||
Pass in the location/name of file if different | ||
- configFile (default: looks for `.csslintrc` in your root directory.) | ||
Pass in the location/name of file if different | ||
@@ -44,4 +44,4 @@ ``` | ||
- failOnWarning (default: true) | ||
If you don't pass in any config file, csslint's default setting sets all rules to 1 (warning) | ||
- failWarning (default: true) | ||
If you don't pass in any config file, csslint's default setting sets all rules to 1 (warning) | ||
Forcing an error by default on warnings. Can disable by passing false as value | ||
@@ -52,1 +52,4 @@ | ||
``` | ||
- failOnError (default: true) | ||
Passing this as true will fail the build and give the correct exit status |
7387
6
53
172