diff options
author | Chris Rebert <github@chrisrebert.com> | 2016-03-07 14:22:32 +0300 |
---|---|---|
committer | Chris Rebert <github@chrisrebert.com> | 2016-03-07 14:22:32 +0300 |
commit | 2cfb28ebd78bc91c47e875ede03f8cdb4bdb9229 (patch) | |
tree | 7a7d4fcf7f15bee4d70022fb5847d1ef600dac06 | |
parent | f6c9fe442465f3f2e21b2d97b1c6b8c42bac3709 (diff) | |
parent | 48381abb95b421c9dabda6ceba96c0a6d498409f (diff) |
Merge pull request #63 from twbs/deps
Update devDependencies.
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | package.json | 12 | ||||
-rw-r--r-- | tasks/bootlint.js | 60 |
3 files changed, 37 insertions, 36 deletions
@@ -9,7 +9,6 @@ [![devDependency Status](https://img.shields.io/david/dev/twbs/grunt-bootlint.svg)](https://david-dm.org/twbs/grunt-bootlint#info=devDependencies) ## Getting Started -This plugin requires Grunt `>=0.4.0` If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command: diff --git a/package.json b/package.json index add4699..bab98e4 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "author": "Zac Echola <zac.echola@gmail.com>", "repository": { "type": "git", - "url": "https://github.com/twbs/grunt-bootlint.git" + "url": "git+https://github.com/twbs/grunt-bootlint.git" }, "bugs": { "url": "https://github.com/twbs/grunt-bootlint/issues" @@ -33,12 +33,12 @@ "micromatch": "^2.2.0" }, "devDependencies": { - "grunt": "~0.4.5", - "grunt-contrib-clean": "^0.7.0", - "grunt-contrib-jshint": "^0.11.0", - "grunt-contrib-nodeunit": "^0.4.1" + "grunt": "^0.4.5", + "grunt-contrib-clean": "^1.0.0", + "grunt-contrib-jshint": "^1.0.0", + "grunt-contrib-nodeunit": "^1.0.0" }, "peerDependencies": { - "grunt": "~0.4.5" + "grunt": ">=0.4.5" } } diff --git a/tasks/bootlint.js b/tasks/bootlint.js index feeaf21..ae014d9 100644 --- a/tasks/bootlint.js +++ b/tasks/bootlint.js @@ -15,6 +15,7 @@ module.exports = function(grunt) { grunt.registerMultiTask('bootlint', 'An HTML linter for Bootstrap projects', function() { + var options = this.options({ stoponerror: false, stoponwarning: false, @@ -25,6 +26,36 @@ module.exports = function(grunt) { var totalErrCount = 0; var totalFileCount = 0; + function getDisabledIdsForFilepath(filepath) { + // Relaxerror defined as array without filepaths + if (options.relaxerror instanceof Array) { + return options.relaxerror; + } + + // Relaxerror as object with error IDs as keys and filepaths as values + var disabledIds = Object.keys(options.relaxerror); + + // Lookup disabled IDs filepaths + var returnIds = disabledIds.filter(function(key) { + var paths = options.relaxerror[key]; + + // handle 'E001': true, 'E001': [] + if (!(paths instanceof Array) || paths.length === 0) { + return true; + } + + // handle 'E001': ['*'] + if (paths.indexOf('*') !== -1) { + return true; + } + + // test filepath pattern + return micromatch.any(filepath, paths); + }); + + return returnIds; + } + // Iterate over all specified file groups. this.files.forEach(function(f) { @@ -89,34 +120,5 @@ module.exports = function(grunt) { }); - function getDisabledIdsForFilepath(filepath) { - // Relaxerror defined as array without filepaths - if (options.relaxerror instanceof Array) { - return options.relaxerror; - } - - // Relaxerror as object with error IDs as keys and filepaths as values - var disabledIds = Object.keys(options.relaxerror); - - // Lookup disabled IDs filepaths - var returnIds = disabledIds.filter(function(key) { - var paths = options.relaxerror[key]; - - // handle 'E001': true, 'E001': [] - if (!(paths instanceof Array) || paths.length === 0) { - return true; - } - - // handle 'E001': ['*'] - if (paths.indexOf('*') !== -1) { - return true; - } - - // test filepath pattern - return micromatch.any(filepath, paths); - }); - - return returnIds; - } }); }; |