From 6e8d9aece6cca960e6435bc9b7c043859d56d17a Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sun, 22 Sep 2019 16:54:18 +0300 Subject: Minor tweaks. Use `startsWith` and move a variable. --- tasks/bootlint.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tasks/bootlint.js b/tasks/bootlint.js index f3a9325..5970c77 100644 --- a/tasks/bootlint.js +++ b/tasks/bootlint.js @@ -65,9 +65,10 @@ module.exports = function(grunt) { }) .forEach((filepath) => { const src = grunt.file.read(filepath); + const disabledIds = getDisabledIdsForFilepath(filepath); const reporter = (lint) => { - const isError = lint.id[0] === 'E'; - const isWarning = lint.id[0] === 'W'; + const isError = lint.id.startsWith('E'); + const isWarning = lint.id.startsWith('W'); const lintId = isError ? chalk.bgGreen.white(lint.id) : chalk.bgRed.white(lint.id); let output = false; @@ -93,8 +94,6 @@ module.exports = function(grunt) { } }; - const disabledIds = getDisabledIdsForFilepath(filepath); - bootlint.lintHtml(src, reporter, disabledIds); totalFileCount++; }); -- cgit v1.2.3