diff options
author | XhmikosR <xhmikosr@gmail.com> | 2019-09-22 16:54:18 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2019-09-22 16:54:18 +0300 |
commit | 6e8d9aece6cca960e6435bc9b7c043859d56d17a (patch) | |
tree | c7763ed7ad131db9662140bdf8f638cebaf43e38 | |
parent | c2e7080d2edd0997e853a943ece764114d9da5ca (diff) |
Minor tweaks.
Use `startsWith` and move a variable.
-rw-r--r-- | tasks/bootlint.js | 7 |
1 files 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++; }); |