Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/grunt-bootlint.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@gmail.com>2018-12-28 18:57:17 +0300
committerXhmikosR <xhmikosr@gmail.com>2018-12-28 19:11:42 +0300
commitaefcb563306e99aa032464f6be6bc32e9656761d (patch)
tree5404918568dd12d58ec01ef61cf69995b3462078
parent7aab0e4329273c9ec4de12679f27267f8f969c8c (diff)
Minor lint tweaks.
-rw-r--r--Gruntfile.js2
-rw-r--r--tasks/bootlint.js13
2 files changed, 3 insertions, 12 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
index f3fa1b6..48ac214 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -9,7 +9,6 @@
'use strict';
module.exports = function(grunt) {
-
// Project configuration.
grunt.initConfig({
jshint: {
@@ -136,5 +135,4 @@ module.exports = function(grunt) {
// By default, run all tests.
grunt.registerTask('default', 'test');
-
};
diff --git a/tasks/bootlint.js b/tasks/bootlint.js
index fcd6656..f3a9325 100644
--- a/tasks/bootlint.js
+++ b/tasks/bootlint.js
@@ -26,7 +26,7 @@ module.exports = function(grunt) {
function getDisabledIdsForFilepath(filepath) {
// Relaxerror defined as array without filepaths
- if (options.relaxerror instanceof Array) {
+ if (Array.isArray(options.relaxerror)) {
return options.relaxerror;
}
@@ -38,7 +38,7 @@ module.exports = function(grunt) {
const paths = options.relaxerror[key];
// handle 'E001': true, 'E001': []
- if (!(paths instanceof Array) || paths.length === 0) {
+ if (!Array.isArray(paths) || paths.length === 0) {
return true;
}
@@ -56,17 +56,14 @@ module.exports = function(grunt) {
// Iterate over all specified file groups.
this.files.forEach((f) => {
-
f.src.filter((filepath) => {
if (!grunt.file.exists(filepath)) {
grunt.log.warn(`Source file "${filepath}" not found.`);
return false;
}
return true;
-
})
.forEach((filepath) => {
-
const src = grunt.file.read(filepath);
const reporter = (lint) => {
const isError = lint.id[0] === 'E';
@@ -82,7 +79,6 @@ module.exports = function(grunt) {
totalErrCount++;
output = true;
});
-
}
if (!output) {
@@ -91,11 +87,10 @@ module.exports = function(grunt) {
}
if (!options.showallerrors) {
- if (isError && options.stoponerror || isWarning && options.stoponwarning) {
+ if ((isError && options.stoponerror) || (isWarning && options.stoponwarning)) {
grunt.fail.warn('Too many bootlint errors.');
}
}
-
};
const disabledIds = getDisabledIdsForFilepath(filepath);
@@ -117,8 +112,6 @@ module.exports = function(grunt) {
} else {
grunt.log.ok(`${totalFileCount} ${fileStr} lint free.`);
}
-
});
-
});
};