gulp-htmlhint
Advanced tools
Comparing version 3.0.1 to 4.0.0
32
index.js
@@ -118,14 +118,8 @@ const fs = require('fs'); | ||
'use strict'; | ||
return file.htmlhint.messages.map(msg => { | ||
const {error: message} = msg; | ||
return file.htmlhint.messages.map(message_ => { | ||
const {error: message} = message_; | ||
let {evidence} = message; | ||
const {line, col} = message; | ||
let detail; | ||
const detail = line ? c.yellow('L' + line) + c.red(':') + c.yellow('C' + col) : c.yellow('GENERAL'); | ||
if (line) { | ||
detail = c.yellow('L' + line) + c.red(':') + c.yellow('C' + col); | ||
} else { | ||
detail = c.yellow('GENERAL'); | ||
} | ||
if (col === 0) { | ||
@@ -200,5 +194,5 @@ evidence = c.red('?') + evidence; | ||
htmlhintPlugin.failOnError = function (opts) { | ||
htmlhintPlugin.failOnError = function (options) { | ||
'use strict'; | ||
opts = opts || {}; | ||
options = options || {}; | ||
return through2.obj((file, enc, cb) => { | ||
@@ -208,3 +202,3 @@ // Something to report and has errors | ||
if (file.htmlhint && !file.htmlhint.success) { | ||
if (opts.suppress === true) { | ||
if (options.suppress === true) { | ||
error = new PluginError('gulp-htmlhint', { | ||
@@ -217,4 +211,4 @@ message: 'HTMLHint failed.', | ||
const plural = errorCount === 1 ? '' : 's'; | ||
const msg = c.cyan(errorCount) + ' error' + plural + ' found in ' + c.magenta(file.path); | ||
const messages = [msg].concat(getMessagesForFile(file).map(m => { | ||
const message = c.cyan(errorCount) + ' error' + plural + ' found in ' + c.magenta(file.path); | ||
const messages = [message].concat(getMessagesForFile(file).map(m => { | ||
return m.message; | ||
@@ -234,5 +228,5 @@ })); | ||
htmlhintPlugin.failAfterError = function (opts) { | ||
htmlhintPlugin.failAfterError = function (options) { | ||
'use strict'; | ||
opts = opts || {}; | ||
options = options || {}; | ||
let globalErrorCount = 0; | ||
@@ -244,3 +238,3 @@ let globalErrorMessage = ''; | ||
if (file.htmlhint && !file.htmlhint.success) { | ||
if (opts.suppress === true) { | ||
if (options.suppress === true) { | ||
globalErrorCount += file.htmlhint.errorCount; | ||
@@ -250,4 +244,4 @@ } else { | ||
const plural = file.htmlhint.errorCount === 1 ? '' : 's'; | ||
const msg = c.cyan(file.htmlhint.errorCount) + ' error' + plural + ' found in ' + c.magenta(file.path); | ||
const messages = [msg].concat(getMessagesForFile(file).map(m => { | ||
const message = c.cyan(file.htmlhint.errorCount) + ' error' + plural + ' found in ' + c.magenta(file.path); | ||
const messages = [message].concat(getMessagesForFile(file).map(m => { | ||
return m.message; | ||
@@ -254,0 +248,0 @@ })); |
{ | ||
"name": "gulp-htmlhint", | ||
"version": "3.0.1", | ||
"version": "4.0.0", | ||
"description": "A plugin for Gulp", | ||
@@ -26,11 +26,11 @@ "keywords": [ | ||
"fancy-log": "^1.3.2", | ||
"htmlhint": "^0.10.1", | ||
"htmlhint": "^0.14.2", | ||
"plugin-error": "^1.0.1", | ||
"strip-ansi": "^6.0.0", | ||
"strip-json-comments": "^3.0.1", | ||
"strip-json-comments": "^3.1.1", | ||
"through2": "^3.0.1", | ||
"vinyl": "^2.2.0" | ||
"vinyl": "^2.2.1" | ||
}, | ||
"devDependencies": { | ||
"coveralls": "^3.0.2", | ||
"coveralls": "^3.1.0", | ||
"htmlhint-stylish": "^1.0.3", | ||
@@ -41,3 +41,3 @@ "mocha": "^6.2.2", | ||
"vinyl-fs": "^3.0.3", | ||
"xo": "^0.25.3" | ||
"xo": "^0.36.1" | ||
}, | ||
@@ -48,3 +48,3 @@ "xo": { | ||
"engines": { | ||
"node": ">=8" | ||
"node": ">=10" | ||
}, | ||
@@ -51,0 +51,0 @@ "licenses": [ |
@@ -30,3 +30,3 @@ /* eslint-env node, mocha */ | ||
let someTagOccurrences = 0; | ||
let someTagIsFirstEl = false; | ||
let someTagIsFirstElement = false; | ||
let iteration = 0; | ||
@@ -36,3 +36,3 @@ function onTagStart(event) { | ||
if (tagName === 'some-tag' && iteration === 0) { | ||
someTagIsFirstEl = true; | ||
someTagIsFirstElement = true; | ||
someTagOccurrences++; | ||
@@ -43,3 +43,3 @@ } else if (tagName === 'some-tag' && iteration > 0) { | ||
if (!someTagIsFirstEl) { | ||
if (!someTagIsFirstElement) { | ||
reporter.error('The tag <some-tag> must be present as first element.', event.line, event.col, self, event.raw); | ||
@@ -46,0 +46,0 @@ parser.removeListener('tagstart', onTagStart); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34151
704
+ Addedansi-styles@4.3.0(transitive)
+ Addedasync@3.2.0(transitive)
+ Addedchalk@4.1.0(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcommander@5.1.0(transitive)
+ Addedglob@7.1.6(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedhtmlhint@0.14.2(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedstrip-json-comments@3.1.0(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedtough-cookie@2.5.0(transitive)
- Removedasync@2.6.1(transitive)
- Removedcli@1.0.1(transitive)
- Removedcolors@1.3.2(transitive)
- Removedcommander@2.17.1(transitive)
- Removedconsole-browserify@1.1.0(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedcsslint@1.0.5(transitive)
- Removeddate-now@0.1.4(transitive)
- Removeddom-serializer@0.2.2(transitive)
- Removeddomelementtype@1.3.12.3.0(transitive)
- Removeddomhandler@2.3.0(transitive)
- Removeddomutils@1.5.1(transitive)
- Removedentities@1.0.02.2.0(transitive)
- Removedexit@0.1.2(transitive)
- Removedglob@7.1.3(transitive)
- Removedhtmlhint@0.10.3(transitive)
- Removedhtmlparser2@3.8.3(transitive)
- Removedisarray@0.0.1(transitive)
- Removedjshint@2.13.6(transitive)
- Removedlodash@4.17.21(transitive)
- Removedminimatch@3.0.8(transitive)
- Removedparserlib@1.1.1(transitive)
- Removedpath-parse@1.0.6(transitive)
- Removedpunycode@1.4.1(transitive)
- Removedreadable-stream@1.1.14(transitive)
- Removedrequest@2.88.0(transitive)
- Removedstring_decoder@0.10.31(transitive)
- Removedstrip-json-comments@1.0.42.0.1(transitive)
- Removedtough-cookie@2.4.3(transitive)
Updatedhtmlhint@^0.14.2
Updatedstrip-json-comments@^3.1.1
Updatedvinyl@^2.2.1