diff options
author | XhmikosR <xhmikosr@gmail.com> | 2016-02-20 12:08:11 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2016-03-07 11:25:53 +0300 |
commit | 48381abb95b421c9dabda6ceba96c0a6d498409f (patch) | |
tree | 7a7d4fcf7f15bee4d70022fb5847d1ef600dac06 /tasks | |
parent | f6c9fe442465f3f2e21b2d97b1c6b8c42bac3709 (diff) |
Update devDependencies.
Diffstat (limited to 'tasks')
-rw-r--r-- | tasks/bootlint.js | 60 |
1 files changed, 31 insertions, 29 deletions
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; - } }); }; |