Skip to content

Commit e2739de

Browse files
author
Ben Zörb
committed
Bump dependencies
1 parent da2c5a9 commit e2739de

File tree

4 files changed

+3111
-1887
lines changed

4 files changed

+3111
-1887
lines changed

index.js

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,11 @@ const htmlhintPlugin = function (options, customRules) {
115115

116116
function getMessagesForFile(file) {
117117
'use strict';
118-
return file.htmlhint.messages.map(msg => {
119-
const {error: message} = msg;
118+
return file.htmlhint.messages.map(message_ => {
119+
const {error: message} = message_;
120120
let {evidence} = message;
121121
const {line, col} = message;
122-
let detail;
123-
124-
if (line) {
125-
detail = c.yellow('L' + line) + c.red(':') + c.yellow('C' + col);
126-
} else {
127-
detail = c.yellow('GENERAL');
128-
}
122+
const detail = line ? c.yellow('L' + line) + c.red(':') + c.yellow('C' + col) : c.yellow('GENERAL');
129123

130124
if (col === 0) {
131125
evidence = c.red('?') + evidence;
@@ -196,23 +190,23 @@ htmlhintPlugin.reporter = function (customReporter, options) {
196190
});
197191
};
198192

199-
htmlhintPlugin.failOnError = function (opts) {
193+
htmlhintPlugin.failOnError = function (options) {
200194
'use strict';
201-
opts = opts || {};
195+
options = options || {};
202196
return through2.obj((file, enc, cb) => {
203197
// Something to report and has errors
204198
let error;
205199
if (file.htmlhint && !file.htmlhint.success) {
206-
if (opts.suppress === true) {
200+
if (options.suppress === true) {
207201
error = new PluginError('gulp-htmlhint', {
208202
message: 'HTMLHint failed.',
209203
showStack: false
210204
});
211205
} else {
212206
const {errorCount} = file.htmlhint;
213207
const plural = errorCount === 1 ? '' : 's';
214-
const msg = c.cyan(errorCount) + ' error' + plural + ' found in ' + c.magenta(file.path);
215-
const messages = [msg].concat(getMessagesForFile(file).map(m => {
208+
const message = c.cyan(errorCount) + ' error' + plural + ' found in ' + c.magenta(file.path);
209+
const messages = [message].concat(getMessagesForFile(file).map(m => {
216210
return m.message;
217211
}));
218212

@@ -227,22 +221,22 @@ htmlhintPlugin.failOnError = function (opts) {
227221
});
228222
};
229223

230-
htmlhintPlugin.failAfterError = function (opts) {
224+
htmlhintPlugin.failAfterError = function (options) {
231225
'use strict';
232-
opts = opts || {};
226+
options = options || {};
233227
let globalErrorCount = 0;
234228
let globalErrorMessage = '';
235229
return through2.obj(check, summarize);
236230

237231
function check(file, enc, cb) {
238232
if (file.htmlhint && !file.htmlhint.success) {
239-
if (opts.suppress === true) {
233+
if (options.suppress === true) {
240234
globalErrorCount += file.htmlhint.errorCount;
241235
} else {
242236
globalErrorCount += file.htmlhint.errorCount;
243237
const plural = file.htmlhint.errorCount === 1 ? '' : 's';
244-
const msg = c.cyan(file.htmlhint.errorCount) + ' error' + plural + ' found in ' + c.magenta(file.path);
245-
const messages = [msg].concat(getMessagesForFile(file).map(m => {
238+
const message = c.cyan(file.htmlhint.errorCount) + ' error' + plural + ' found in ' + c.magenta(file.path);
239+
const messages = [message].concat(getMessagesForFile(file).map(m => {
246240
return m.message;
247241
}));
248242

0 commit comments

Comments
 (0)