From 48381abb95b421c9dabda6ceba96c0a6d498409f Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sat, 20 Feb 2016 11:08:11 +0200 Subject: Update devDependencies. --- README.md | 1 - package.json | 12 +++++------ tasks/bootlint.js | 60 ++++++++++++++++++++++++++++--------------------------- 3 files changed, 37 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 307e763..51ee71c 100644 --- a/README.md +++ b/README.md @@ -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 ", "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; - } }); }; -- cgit v1.2.3