gulp-csslint
Advanced tools
Comparing version 0.2.0 to 0.2.1
22
index.js
'use strict'; | ||
var gutil = require('gulp-util'); | ||
var error = gutil.PluginError; | ||
var through = require('through2'); | ||
@@ -37,16 +36,13 @@ var csslint = require('csslint').CSSLint; | ||
options = options || {}; | ||
var ruleset = {}; | ||
var rcLoader = new RcLoader('.csslintrc', options, { loader: 'async' }); | ||
// Build a list of all available rules | ||
csslint.getRules().forEach(function(rule) { | ||
ruleset[rule.id] = 1; | ||
}); | ||
return through.obj(function(file, enc, cb) { | ||
if (file.isNull()) return cb(null, file); // pass along | ||
if (file.isStream()) return cb(new error('gulp-csslint: Streaming not supported'), file); | ||
if (file.isStream()) return cb(new gutil.PluginError('gulp-csslint: Streaming not supported'), file); | ||
var ruleset = {}; | ||
// Build a list of all available rules | ||
csslint.getRules().forEach(function(rule) { | ||
ruleset[rule.id] = 1; | ||
}); | ||
var content = file.contents.toString(enc); | ||
@@ -131,3 +127,3 @@ | ||
cssLintPlugin.addRule = function(rule) { | ||
if(typeof rule !== 'object') { | ||
if (typeof rule !== 'object') { | ||
throw new Error('Invalid rule: rules need to be objects.'); | ||
@@ -145,3 +141,3 @@ } | ||
return cb(new gutil.PluginError('gulp-csslint', 'CSSLint failed for '+file.relative), file); | ||
return cb(new gutil.PluginError('gulp-csslint', 'CSSLint failed for ' + file.relative), file); | ||
}); | ||
@@ -148,0 +144,0 @@ }; |
{ | ||
"name": "gulp-csslint", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "CSSLint plugin for gulp", | ||
@@ -17,5 +17,7 @@ "main": "index.js", | ||
"coveralls": "^2.11.2", | ||
"eslint": "^1.1.0", | ||
"eslint-config-semistandard": "^5.0.0", | ||
"eslint-config-standard": "^4.1.0", | ||
"eslint-plugin-standard": "^1.2.0", | ||
"istanbul": "^0.3.14", | ||
"jscs": "^1.13.1", | ||
"jshint": "^2.7.0", | ||
"mocha": "^2.2.5", | ||
@@ -28,7 +30,7 @@ "rimraf": "^2.3.4", | ||
"clean": "rimraf coverage/", | ||
"lint": "jscs index.js test/ && jshint index.js test/", | ||
"cover": "istanbul cover _mocha", | ||
"lint": "eslint index.js test/main.js", | ||
"precover": "npm run lint && npm run clean", | ||
"pretest": "npm run lint", | ||
"test": "mocha", | ||
"precover": "npm run lint && npm run clean", | ||
"cover": "istanbul cover _mocha" | ||
"test": "mocha" | ||
}, | ||
@@ -40,4 +42,4 @@ "repository": { | ||
"keywords": [ | ||
"gulpplugin", | ||
"csslint" | ||
"csslint", | ||
"gulpplugin" | ||
], | ||
@@ -44,0 +46,0 @@ "author": "Larry Davis <lazdnet@gmail.com>", |
@@ -35,3 +35,3 @@ # gulp-csslint [![NPM version][npm-image]][npm-url] [![Build status][travis-image]][travis-url] [![Test coverage][coveralls-image]][coveralls-url] [![Dependency status][david-image]][david-url] | ||
Any properties passed wil be in _addition_ to (or overwriting) the ones in .csslintrc (unless `lookup: false` is passed). | ||
Any properties passed will be in _addition_ to (or overwriting) the ones in .csslintrc (unless `lookup: false` is passed). | ||
@@ -38,0 +38,0 @@ ```js |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
9727
0
10
116