Comparing version
@@ -1,66 +0,51 @@ | ||
var path = require('path') | ||
var events = require('events') | ||
var glob = require('glob') | ||
path.parse = path.parse || require('path-parse') | ||
var mapFormatters | ||
var arrSupportedFormatters | ||
var HTMLHint | ||
var options | ||
// load formatters | ||
mapFormatters = loadFormatters() | ||
arrSupportedFormatters = [] | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var events_1 = require("events"); | ||
var glob = require("glob"); | ||
var path = require("path"); | ||
path.parse = path.parse || require('path-parse'); | ||
var HTMLHint; | ||
var options; | ||
var mapFormatters = loadFormatters(); | ||
var arrSupportedFormatters = []; | ||
for (var formatterName in mapFormatters) { | ||
if (formatterName !== 'default') { | ||
arrSupportedFormatters.push(formatterName) | ||
} | ||
if (formatterName !== 'default') { | ||
arrSupportedFormatters.push(formatterName); | ||
} | ||
} | ||
// load all formatters | ||
function loadFormatters() { | ||
var arrFiles = glob.sync('./formatters/*.js', { | ||
cwd: __dirname, | ||
dot: false, | ||
nodir: true, | ||
strict: false, | ||
silent: true, | ||
}) | ||
var mapFormatters = {} | ||
arrFiles.forEach(function (file) { | ||
var fileInfo = path.parse(file) | ||
var formatterPath = path.resolve(__dirname, file) | ||
mapFormatters[fileInfo.name] = require(formatterPath) | ||
}) | ||
return mapFormatters | ||
var arrFiles = glob.sync('./formatters/*.js', { | ||
cwd: __dirname, | ||
dot: false, | ||
nodir: true, | ||
strict: false, | ||
silent: true, | ||
}); | ||
var mapFormatters = {}; | ||
arrFiles.forEach(function (file) { | ||
var fileInfo = path.parse(file); | ||
var formatterPath = path.resolve(__dirname, file); | ||
mapFormatters[fileInfo.name] = require(formatterPath); | ||
}); | ||
return mapFormatters; | ||
} | ||
var formatter = new events.EventEmitter() | ||
var formatter = new events_1.EventEmitter(); | ||
formatter.getSupported = function () { | ||
return arrSupportedFormatters | ||
} | ||
return arrSupportedFormatters; | ||
}; | ||
formatter.init = function (tmpHTMLHint, tmpOptions) { | ||
HTMLHint = tmpHTMLHint | ||
options = tmpOptions | ||
} | ||
HTMLHint = tmpHTMLHint; | ||
options = tmpOptions; | ||
}; | ||
formatter.setFormat = function (format) { | ||
var formatHandel = mapFormatters[format] | ||
if (formatHandel === undefined) { | ||
console.log( | ||
'No supported formatter, supported formatters: %s'.red, | ||
arrSupportedFormatters.join(', ') | ||
) | ||
process.exit(1) | ||
} else { | ||
formatHandel(formatter, HTMLHint, options) | ||
} | ||
} | ||
module.exports = formatter | ||
var formatHandel = mapFormatters[format]; | ||
if (formatHandel === undefined) { | ||
console.log('No supported formatter, supported formatters: %s'.red, arrSupportedFormatters.join(', ')); | ||
process.exit(1); | ||
} | ||
else { | ||
formatHandel(formatter, HTMLHint, options); | ||
} | ||
}; | ||
module.exports = formatter; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybWF0dGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2Jpbi9mb3JtYXR0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxpQ0FBcUM7QUFDckMsMkJBQTRCO0FBQzVCLDJCQUE0QjtBQUk1QixJQUFJLENBQUMsS0FBSyxHQUFHLElBQUksQ0FBQyxLQUFLLElBQUksT0FBTyxDQUFDLFlBQVksQ0FBQyxDQUFBO0FBRWhELElBQUksUUFBMEIsQ0FBQTtBQUM5QixJQUFJLE9BQVksQ0FBQTtBQUdoQixJQUFNLGFBQWEsR0FBRyxjQUFjLEVBQUUsQ0FBQTtBQUN0QyxJQUFNLHNCQUFzQixHQUFhLEVBQUUsQ0FBQTtBQUUzQyxLQUFLLElBQU0sYUFBYSxJQUFJLGFBQWEsRUFBRTtJQUN6QyxJQUFJLGFBQWEsS0FBSyxTQUFTLEVBQUU7UUFDL0Isc0JBQXNCLENBQUMsSUFBSSxDQUFDLGFBQWEsQ0FBQyxDQUFBO0tBQzNDO0NBQ0Y7QUFHRCxTQUFTLGNBQW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7SUFFMUMsSUFBSSxZQUFZLEtBQUssU0FBUyxFQUFFO1FBQzlCLE9BQU8sQ0FBQyxHQUFHLENBQ1Qsa0RBQWtELENBQUMsR0FBRyxFQUN0RCxzQkFBc0IsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQ2xDLENBQUE7UUFDRCxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFBO0tBQ2hCO1NBQU07UUFDTCxZQUFZLENBQUMsU0FBUyxFQUFFLFFBQVEsRUFBRSxPQUFPLENBQUMsQ0FBQTtLQUMzQztBQUNILENBQUMsQ0FBQTtBQVFELE1BQU0sQ0FBQyxPQUFPLEdBQUcsU0FBUyxDQUFBIn0= |
@@ -1,56 +0,50 @@ | ||
var xml = require('xml') | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var xml = require("xml"); | ||
var checkstyleFormatter = function (formatter) { | ||
formatter.on('end', function (event) { | ||
var arrFiles = [] | ||
var arrAllMessages = event.arrAllMessages | ||
arrAllMessages.forEach(function (fileInfo) { | ||
var arrMessages = fileInfo.messages | ||
var arrErrors = [] | ||
arrMessages.forEach(function (message) { | ||
arrErrors.push({ | ||
error: { | ||
_attr: { | ||
line: message.line, | ||
column: message.col, | ||
severity: message.type, | ||
message: message.message, | ||
source: 'htmlhint.' + message.rule.id, | ||
}, | ||
}, | ||
}) | ||
}) | ||
arrFiles.push({ | ||
file: [ | ||
{ | ||
_attr: { | ||
name: fileInfo.file, | ||
}, | ||
}, | ||
].concat(arrErrors), | ||
}) | ||
}) | ||
var objXml = { | ||
checkstyle: [ | ||
{ | ||
_attr: { | ||
version: '4.3', | ||
}, | ||
}, | ||
].concat(arrFiles), | ||
} | ||
console.log( | ||
xml(objXml, { | ||
declaration: true, | ||
indent: ' ', | ||
}) | ||
) | ||
}) | ||
} | ||
module.exports = checkstyleFormatter | ||
formatter.on('end', function (event) { | ||
var arrFiles = []; | ||
var arrAllMessages = event.arrAllMessages; | ||
arrAllMessages.forEach(function (fileInfo) { | ||
var arrMessages = fileInfo.messages; | ||
var arrErrors = []; | ||
arrMessages.forEach(function (message) { | ||
arrErrors.push({ | ||
error: { | ||
_attr: { | ||
line: message.line, | ||
column: message.col, | ||
severity: message.type, | ||
message: message.message, | ||
source: "htmlhint." + message.rule.id, | ||
}, | ||
}, | ||
}); | ||
}); | ||
arrFiles.push({ | ||
file: [ | ||
{ | ||
_attr: { | ||
name: fileInfo.file, | ||
}, | ||
}, | ||
].concat(arrErrors), | ||
}); | ||
}); | ||
var objXml = { | ||
checkstyle: [ | ||
{ | ||
_attr: { | ||
version: '4.3', | ||
}, | ||
}, | ||
].concat(arrFiles), | ||
}; | ||
console.log(xml(objXml, { | ||
declaration: true, | ||
indent: ' ', | ||
})); | ||
}); | ||
}; | ||
module.exports = checkstyleFormatter; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hlY2tzdHlsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9iaW4vZm9ybWF0dGVycy9jaGVja3N0eWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEseUJBQTBCO0FBSTFCLElBQU0sbUJBQW1CLEdBQXNCLFVBQVUsU0FBUztJQUNoRSxTQUFTLENBQUMsRUFBRSxDQUFDLEtBQUssRUFBRSxVQUFDLEtBQUs7UUFDeEIsSUFBTSxRQUFRLEdBQWdCLEVBQUUsQ0FBQTtRQUNoQyxJQUFNLGNBQWMsR0FBRyxLQUFLLENBQUMsY0FBYyxDQUFBO1FBRTNDLGNBQWMsQ0FBQyxPQUFPLENBQUMsVUFBQyxRQUFRO1lBQzlCLElBQU0sV0FBVyxHQUFHLFFBQVEsQ0FBQyxRQUFRLENBQUE7WUFDckMsSUFBTSxTQUFTLEdBQWdCLEVBQUUsQ0FBQTtZQUVqQyxXQUFXLENBQUMsT0FBTyxDQUFDLF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|
@@ -0,28 +1,20 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var compactFormatter = function (formatter, HTMLHint, options) { | ||
var nocolor = options.nocolor | ||
formatter.on('file', function (event) { | ||
event.messages.forEach(function (message) { | ||
console.log( | ||
'%s: line %d, col %d, %s - %s (%s)', | ||
event.file, | ||
message.line, | ||
message.col, | ||
message.type, | ||
message.message, | ||
message.rule.id | ||
) | ||
}) | ||
}) | ||
formatter.on('end', function (event) { | ||
var allHintCount = event.allHintCount | ||
if (allHintCount > 0) { | ||
console.log('') | ||
var message = '%d problems' | ||
console.log(nocolor ? message : message.red, event.allHintCount) | ||
} | ||
}) | ||
} | ||
module.exports = compactFormatter | ||
var nocolor = options.nocolor; | ||
formatter.on('file', function (event) { | ||
event.messages.forEach(function (message) { | ||
console.log('%s: line %d, col %d, %s - %s (%s)', event.file, message.line, message.col, message.type, message.message, message.rule.id); | ||
}); | ||
}); | ||
formatter.on('end', function (event) { | ||
var allHintCount = event.allHintCount; | ||
if (allHintCount > 0) { | ||
console.log(''); | ||
var message = '%d problems'; | ||
console.log(nocolor ? message : message.red, event.allHintCount); | ||
} | ||
}); | ||
}; | ||
module.exports = compactFormatter; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcGFjdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9iaW4vZm9ybWF0dGVycy9jb21wYWN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBRUEsSUFBTSxnQkFBZ0IsR0FBc0IsVUFDMUMsU0FBUyxFQUNULFFBQVEsRUFDUixPQUFPO0lBRVAsSUFBTSxPQUFPLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQTtJQUUvQixTQUFTLENBQUMsRUFBRSxDQUFDLE1BQU0sRUFBRSxVQUFDLEtBQUs7UUFDekIsS0FBSyxDQUFDLFFBQVEsQ0FBQyxPQUFPLENBQUMsVUFBQyxPQUFPO1lBQzdCLE9BQU8sQ0FBQyxHQUFHLENBQ1QsbUNBQW1DLEVBQ25DLEtBQUssQ0FBQyxJQUFJLEVBQ1YsT0FBTyxDQUFDLElBQUksRUFDWixPQUFPLENBQUMsR0FBRyxFQUNYLE9BQU8sQ0FBQyxJQUFJLEVBQ1osT0FBTyxDQUFDLE9BQU8sRUFDZixPQUFPLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FDaEIsQ0FBQTtRQUNILENBQUMsQ0FBQyxDQUFBO0lBQ0osQ0FBQyxDQUFDLENBQUE7SUFFRixTQUFTLENBQUMsRUFBRSxDQUFDLEtBQUssRUFBRSxVQUFDLEtBQUs7UUFDeEIsSUFBTSxZQUFZLEdBQUcsS0FBSyxDQUFDLFlBQVksQ0FBQTtRQUN2QyxJQUFJLFlBQVksR0FBRyxDQUFDLEVBQUU7WUFDcEIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsQ0FBQTtZQUNmLElBQU0sT0FBTyxHQUFHLGFBQWEsQ0FBQTtZQUM3QixPQUFPLENBQUMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxPQUFPLENBQUMsR0FBRyxFQUFFLEtBQUssQ0FBQyxZQUFZLENBQUMsQ0FBQTtTQUNqRTtJQUNILENBQUMsQ0FBQyxDQUFBO0FBQ0osQ0FBQyxDQUFBO0FBRUQsTUFBTSxDQUFDLE9BQU8sR0FBRyxnQkFBZ0IsQ0FBQSJ9 |
@@ -0,52 +1,41 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var defaultFormatter = function (formatter, HTMLHint, options) { | ||
var nocolor = options.nocolor | ||
formatter.on('start', function () { | ||
console.log('') | ||
}) | ||
formatter.on('config', function (event) { | ||
var configPath = event.configPath | ||
console.log(' Config loaded: %s', nocolor ? configPath : configPath.cyan) | ||
console.log('') | ||
}) | ||
formatter.on('file', function (event) { | ||
console.log(' ' + event.file.white) | ||
var arrLogs = HTMLHint.format(event.messages, { | ||
colors: nocolor ? false : true, | ||
indent: 6, | ||
}) | ||
arrLogs.forEach(function (str) { | ||
console.log(str) | ||
}) | ||
console.log('') | ||
}) | ||
formatter.on('end', function (event) { | ||
var allFileCount = event.allFileCount | ||
var allHintCount = event.allHintCount | ||
var allHintFileCount = event.allHintFileCount | ||
var time = event.time | ||
var message | ||
if (allHintCount > 0) { | ||
message = 'Scanned %d files, found %d errors in %d files (%d ms)' | ||
console.log( | ||
nocolor ? message : message.red, | ||
allFileCount, | ||
allHintCount, | ||
allHintFileCount, | ||
time | ||
) | ||
} else { | ||
message = 'Scanned %d files, no errors found (%d ms).' | ||
console.log(nocolor ? message : message.green, allFileCount, time) | ||
} | ||
}) | ||
} | ||
module.exports = defaultFormatter | ||
var nocolor = options.nocolor; | ||
formatter.on('start', function () { | ||
console.log(''); | ||
}); | ||
formatter.on('config', function (event) { | ||
var configPath = event.configPath; | ||
console.log(' Config loaded: %s', nocolor ? configPath : configPath.cyan); | ||
console.log(''); | ||
}); | ||
formatter.on('file', function (event) { | ||
console.log(" " + event.file.white); | ||
var arrLogs = HTMLHint.format(event.messages, { | ||
colors: nocolor ? false : true, | ||
indent: 6, | ||
}); | ||
arrLogs.forEach(function (str) { | ||
console.log(str); | ||
}); | ||
console.log(''); | ||
}); | ||
formatter.on('end', function (event) { | ||
var allFileCount = event.allFileCount; | ||
var allHintCount = event.allHintCount; | ||
var allHintFileCount = event.allHintFileCount; | ||
var time = event.time; | ||
var message; | ||
if (allHintCount > 0) { | ||
message = 'Scanned %d files, found %d errors in %d files (%d ms)'; | ||
console.log(nocolor ? message : message.red, allFileCount, allHintCount, allHintFileCount, time); | ||
} | ||
else { | ||
message = 'Scanned %d files, no errors found (%d ms).'; | ||
console.log(nocolor ? message : message.green, allFileCount, time); | ||
} | ||
}); | ||
}; | ||
module.exports = defaultFormatter; | ||
//#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BQUssRUFBRSxZQUFZLEVBQUUsSUFBSSxDQUFDLENBQUE7U0FDbkU7SUFDSCxDQUFDLENBQUMsQ0FBQTtBQUNKLENBQUMsQ0FBQTtBQUVELE1BQU0sQ0FBQyxPQUFPLEdBQUcsZ0JBQWdCLENBQUEifQ== |
@@ -1,41 +0,26 @@ | ||
var fs = require('fs') | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var fs = require("fs"); | ||
var htmlFormatter = function (formatter) { | ||
formatter.on('end', function (event) { | ||
var fileContent | ||
fileContent = '<html>' | ||
fileContent = | ||
fileContent + '<head><title>HTML Hint Violation Report</title></head>' | ||
fileContent = fileContent + '<body>' | ||
fileContent = fileContent + '<center><h2>Violation Report</h2></center>' | ||
fileContent = fileContent + '<table border = 1>' | ||
fileContent = | ||
fileContent + | ||
'<tr><th>Number#</th><th>File Name</th><th>Line Number</th><th>Message</th></tr>' | ||
var arrAllMessages = event.arrAllMessages | ||
arrAllMessages.forEach(function (fileInfo) { | ||
var arrMessages = fileInfo.messages | ||
arrMessages.forEach(function (message, i) { | ||
fileContent = | ||
fileContent + | ||
'<tr><td>' + | ||
(i + 1) + | ||
'</td><td>' + | ||
fileInfo.file + | ||
'</td><td>' + | ||
message.line + | ||
'</td><td>' + | ||
message.message + | ||
'</td></tr>' | ||
}) | ||
}) | ||
fileContent = fileContent.replace('</table></body></html>') | ||
console.log(fileContent) | ||
fs.writeFileSync('report.html', fileContent) | ||
}) | ||
} | ||
module.exports = htmlFormatter | ||
formatter.on('end', function (event) { | ||
var fileContent = '<html>'; | ||
fileContent += '<head><title>HTML Hint Violation Report</title></head>'; | ||
fileContent += '<body>'; | ||
fileContent += '<center><h2>Violation Report</h2></center>'; | ||
fileContent += '<table border = 1>'; | ||
fileContent += | ||
'<tr><th>Number#</th><th>File Name</th><th>Line Number</th><th>Message</th></tr>'; | ||
var arrAllMessages = event.arrAllMessages; | ||
arrAllMessages.forEach(function (fileInfo) { | ||
var arrMessages = fileInfo.messages; | ||
arrMessages.forEach(function (message, i) { | ||
fileContent = fileContent + "<tr><td>" + (i + 1) + "</td><td>" + fileInfo.file + "</td><td>" + message.line + "</td><td>" + message.message + "</td></tr>"; | ||
}); | ||
}); | ||
fileContent = fileContent.replace('</table></body></html>'); | ||
console.log(fileContent); | ||
fs.writeFileSync('report.html', fileContent); | ||
}); | ||
}; | ||
module.exports = htmlFormatter; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHRtbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9iaW4vZm9ybWF0dGVycy9odG1sLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsdUJBQXdCO0FBR3hCLElBQU0sYUFBYSxHQUFzQixVQUFVLFNBQVM7SUFDMUQsU0FBUyxDQUFDLEVBQUUsQ0FBQyxLQUFLLEVBQUUsVUFBQyxLQUFLO1FBQ3hCLElBQUksV0FBVyxHQUFHLFFBQVEsQ0FBQTtRQUMxQixXQUFXLElBQUksd0RBQXdELENBQUE7UUFDdkUsV0FBVyxJQUFJLFFBQVEsQ0FBQTtRQUN2QixXQUFXLElBQUksNENBQTRDLENBQUE7UUFFM0QsV0FBVyxJQUFJLG9CQUFvQixDQUFBO1FBQ25DLFdBQVc7WUFDVCxpRkFBaUYsQ0FBQTtRQUVuRixJQUFNLGNBQWMsR0FBRyxLQUFLLENBQUMsY0FBYyxDQUFBO1FBQzNDLGNBQWMsQ0FBQyxPQUFPLENBQUMsVUFBQyxRQUFRO1lBQzlCLElBQU0sV0FBVyxHQUFHLFFBQVEsQ0FBQyxRQUFRLENBQUE7WUFDckMsV0FBVyxDQUFDLE9BQU8sQ0FBQyxVQUFDLE9BQU8sRUFBRSxDQUFDO2dCQUM3QixXQUFXLEdBQU0sV0FBVyxpQkFBVyxDQUFDLEdBQUcsQ0FBQyxrQkFDMUMsUUFBUSxDQUFDLElBQUksaUJBQ0gsT0FBTyxDQUFDLElBQUksaUJBQVksT0FBTyxDQUFDLE9BQU8sZUFBWSxDQUFBO1lBQ2pFLENBQUMsQ0FBQyxDQUFBO1FBQ0osQ0FBQyxDQUFDLENBQUE7UUFJRixXQUFXLEdBQUcsV0FBVyxDQUFDLE9BQU8sQ0FBQyx3QkFBd0IsQ0FBQyxDQUFBO1FBQzNELE9BQU8sQ0FBQyxHQUFHLENBQUMsV0FBVyxDQUFDLENBQUE7UUFDeEIsRUFBRSxDQUFDLGFBQWEsQ0FBQyxhQUFhLEVBQUUsV0FBVyxDQUFDLENBQUE7SUFDOUMsQ0FBQyxDQUFDLENBQUE7QUFDSixDQUFDLENBQUE7QUFFRCxNQUFNLENBQUMsT0FBTyxHQUFHLGFBQWEsQ0FBQSJ9 |
@@ -0,7 +1,9 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var jsonFormatter = function (formatter) { | ||
formatter.on('end', function (event) { | ||
console.log(JSON.stringify(event.arrAllMessages)) | ||
}) | ||
} | ||
module.exports = jsonFormatter | ||
formatter.on('end', function (event) { | ||
console.log(JSON.stringify(event.arrAllMessages)); | ||
}); | ||
}; | ||
module.exports = jsonFormatter; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoianNvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9iaW4vZm9ybWF0dGVycy9qc29uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBRUEsSUFBTSxhQUFhLEdBQXNCLFVBQVUsU0FBUztJQUMxRCxTQUFTLENBQUMsRUFBRSxDQUFDLEtBQUssRUFBRSxVQUFDLEtBQUs7UUFDeEIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsU0FBUyxDQUFDLEtBQUssQ0FBQyxjQUFjLENBQUMsQ0FBQyxDQUFBO0lBQ25ELENBQUMsQ0FBQyxDQUFBO0FBQ0osQ0FBQyxDQUFBO0FBRUQsTUFBTSxDQUFDLE9BQU8sR0FBRyxhQUFhLENBQUEifQ== |
@@ -1,58 +0,53 @@ | ||
var xml = require('xml') | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var xml = require("xml"); | ||
var junitFormatter = function (formatter, HTMLHint) { | ||
formatter.on('end', function (event) { | ||
var arrTestcase = [] | ||
var arrAllMessages = event.arrAllMessages | ||
arrAllMessages.forEach(function (fileInfo) { | ||
var arrMessages = fileInfo.messages | ||
var arrLogs = HTMLHint.format(arrMessages) | ||
arrTestcase.push({ | ||
testcase: [ | ||
{ | ||
_attr: { | ||
name: fileInfo.file, | ||
time: (fileInfo.time / 1000).toFixed(3), | ||
}, | ||
}, | ||
{ | ||
failure: { | ||
_attr: { | ||
message: 'Found ' + arrMessages.length + ' errors', | ||
}, | ||
_cdata: arrLogs.join('\r\n'), | ||
}, | ||
}, | ||
], | ||
}) | ||
}) | ||
var objXml = { | ||
testsuites: [ | ||
{ | ||
testsuite: [ | ||
{ | ||
_attr: { | ||
name: 'HTMLHint Tests', | ||
time: (event.time / 1000).toFixed(3), | ||
tests: event.allFileCount, | ||
failures: arrAllMessages.length, | ||
}, | ||
}, | ||
].concat(arrTestcase), | ||
}, | ||
], | ||
} | ||
console.log( | ||
xml(objXml, { | ||
declaration: true, | ||
indent: ' ', | ||
}) | ||
) | ||
}) | ||
} | ||
module.exports = junitFormatter | ||
formatter.on('end', function (event) { | ||
var arrTestcase = []; | ||
var arrAllMessages = event.arrAllMessages; | ||
arrAllMessages.forEach(function (fileInfo) { | ||
var arrMessages = fileInfo.messages; | ||
var arrLogs = HTMLHint.format(arrMessages); | ||
arrTestcase.push({ | ||
testcase: [ | ||
{ | ||
_attr: { | ||
name: fileInfo.file, | ||
time: (fileInfo.time / 1000).toFixed(3), | ||
}, | ||
}, | ||
{ | ||
failure: { | ||
_attr: { | ||
message: "Found " + arrMessages.length + " errors", | ||
}, | ||
_cdata: arrLogs.join('\r\n'), | ||
}, | ||
}, | ||
], | ||
}); | ||
}); | ||
var objXml = { | ||
testsuites: [ | ||
{ | ||
testsuite: [ | ||
{ | ||
_attr: { | ||
name: 'HTMLHint Tests', | ||
time: (event.time / 1000).toFixed(3), | ||
tests: event.allFileCount, | ||
failures: arrAllMessages.length, | ||
}, | ||
}, | ||
].concat(arrTestcase), | ||
}, | ||
], | ||
}; | ||
console.log(xml(objXml, { | ||
declaration: true, | ||
indent: ' ', | ||
})); | ||
}); | ||
}; | ||
module.exports = junitFormatter; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoianVuaXQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYmluL2Zvcm1hdHRlcnMvanVuaXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSx5QkFBMEI7QUFJMUIsSUFBTSxjQUFjLEdBQXNCLFVBQVUsU0FBUyxFQUFFLFFBQVE7SUFDckUsU0FBUyxDQUFDLEVBQUUsQ0FBQyxLQUFLLEVBQUUsVUFBQyxLQUFLO1FBQ3hCLElBQU0sV0FBVyxHQUFnQixFQUFFLENBQUE7UUFDbkMsSUFBTSxjQUFjLEdBQUcsS0FBSyxDQUFDLGNBQWMsQ0FBQTtRQUUzQyxjQUFjLENBQUMsT0FBTyxDQUFDLFVBQUMsUUFBUTtZQUM5QixJQUFNLFdBQVcsR0FBRyxRQUFRLENBQUMsUUFBUSxDQUFBO1lBQ3JDLElBQU0sT0FBTyxHQUFHLFFBQVEsQ0FBQyxNQUFNLENBQUMsV0FBVyxDQUFDLENBQUE7WUFFNUMsV0FBVyxDQUFDLElBQUksQ0FBQztnQkFDZixRQUFRLEVBQUU7b0JBQ1I7d0JBQ0UsS0FBSyxFQUFFOzRCQUNMLElBQUksRUFBRSxRQUFRLENBQUMsSUFBSTs0QkFDbkIsSUFBSSxFQUFF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.defineProperty(exports, "__esModule", { value: true }); | ||
var markdownFormatter = function (formatter, HTMLHint) { | ||
formatter.on('end', function (event) { | ||
console.log('# TOC') | ||
var arrToc = [] | ||
var arrContents = [] | ||
var arrAllMessages = event.arrAllMessages | ||
arrAllMessages.forEach(function (fileInfo) { | ||
var filePath = fileInfo.file | ||
var arrMessages = fileInfo.messages | ||
var errorCount = 0 | ||
var warningCount = 0 | ||
arrMessages.forEach(function (message) { | ||
if (message.type === 'error') { | ||
errorCount++ | ||
} else { | ||
warningCount++ | ||
} | ||
}) | ||
arrToc.push(' - [' + filePath + '](#' + filePath + ')') | ||
arrContents.push('<a name="' + filePath + '" />') | ||
arrContents.push('# ' + filePath) | ||
arrContents.push('') | ||
arrContents.push( | ||
'Found ' + errorCount + ' errors, ' + warningCount + ' warnings' | ||
) | ||
var arrLogs = HTMLHint.format(arrMessages) | ||
arrContents.push('') | ||
arrLogs.forEach(function (log) { | ||
arrContents.push(' ' + log) | ||
}) | ||
arrContents.push('') | ||
}) | ||
console.log(arrToc.join('\r\n') + '\r\n') | ||
console.log(arrContents.join('\r\n')) | ||
}) | ||
} | ||
module.exports = markdownFormatter | ||
formatter.on('end', function (event) { | ||
console.log('# TOC'); | ||
var arrToc = []; | ||
var arrContents = []; | ||
var arrAllMessages = event.arrAllMessages; | ||
arrAllMessages.forEach(function (fileInfo) { | ||
var filePath = fileInfo.file; | ||
var arrMessages = fileInfo.messages; | ||
var errorCount = 0; | ||
var warningCount = 0; | ||
arrMessages.forEach(function (message) { | ||
if (message.type === 'error') { | ||
errorCount++; | ||
} | ||
else { | ||
warningCount++; | ||
} | ||
}); | ||
arrToc.push(" - [" + filePath + "](#" + filePath + ")"); | ||
arrContents.push("<a name=\"" + filePath + "\" />"); | ||
arrContents.push("# " + filePath); | ||
arrContents.push(''); | ||
arrContents.push("Found " + errorCount + " errors, " + warningCount + " warnings"); | ||
var arrLogs = HTMLHint.format(arrMessages); | ||
arrContents.push(''); | ||
arrLogs.forEach(function (log) { | ||
arrContents.push(" " + log); | ||
}); | ||
arrContents.push(''); | ||
}); | ||
console.log(arrToc.join('\r\n') + "\r\n"); | ||
console.log(arrContents.join('\r\n')); | ||
}); | ||
}; | ||
module.exports = markdownFormatter; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFya2Rvd24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYmluL2Zvcm1hdHRlcnMvbWFya2Rvd24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFFQSxJQUFNLGlCQUFpQixHQUFzQixVQUFVLFNBQVMsRUFBRSxRQUFRO0lBQ3hFLFNBQVMsQ0FBQyxFQUFFLENBQUMsS0FBSyxFQUFFLFVBQUMsS0FBSztRQUN4QixPQUFPLENBQUMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFBO1FBRXBCLElBQU0sTUFBTSxHQUFhLEVBQUUsQ0FBQTtRQUMzQixJQUFNLFdBQVcsR0FBYSxFQUFFLENBQUE7UUFDaEMsSUFBTSxjQUFjLEdBQUcsS0FBSyxDQUFDLGNBQWMsQ0FBQTtRQUUzQyxjQUFjLENBQUMsT0FBTyxDQUFDLFVBQUMsUUFBUTtZQUM5QixJQUFNLFFBQVEsR0FBRyxRQUFRLENBQUMsSUFBSSxDQUFBO1lBQzlCLElBQU0sV0FBVyxHQUFHLFFBQVEsQ0FBQyxRQUFRLENBQUE7WUFDckMsSUFBSSxVQUFVLEdBQUcsQ0FBQyxDQUFBO1lBQ2xCLElBQUksWUFBWSxHQUFHLENBQUMsQ0FBQTtZQUVwQixXQUFXLENBQUMsT0FBTyxDQUFDLFVBQUMsT0FBTztnQkFDMUIsSUFBSSxPQUFPLENBQUMsSUFBSSxLQUFLLE9BQU8sRUFBRTtvQkFDNUIsVUFBVSxFQUFFLENBQUE7aUJBQ2I7cUJBQU07b0JBQ0wsWUFBWSxFQUFFLENBQUE7aUJBQ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ty(exports, "__esModule", { value: true }); | ||
var unixFormatter = function (formatter, HTMLHint, options) { | ||
var nocolor = options.nocolor | ||
formatter.on('file', function (event) { | ||
event.messages.forEach(function (message) { | ||
console.log( | ||
[ | ||
event.file, | ||
message.line, | ||
message.col, | ||
' ' + | ||
message.message + | ||
' [' + | ||
message.type + | ||
'/' + | ||
message.rule.id + | ||
']', | ||
].join(':') | ||
) | ||
}) | ||
}) | ||
formatter.on('end', function (event) { | ||
var allHintCount = event.allHintCount | ||
if (allHintCount > 0) { | ||
console.log('') | ||
var message = '%d problems' | ||
console.log(nocolor ? message : message.red, event.allHintCount) | ||
} | ||
}) | ||
} | ||
module.exports = unixFormatter | ||
var nocolor = options.nocolor; | ||
formatter.on('file', function (event) { | ||
event.messages.forEach(function (message) { | ||
console.log([ | ||
event.file, | ||
message.line, | ||
message.col, | ||
" " + message.message + " [" + message.type + "/" + message.rule.id + "]", | ||
].join(':')); | ||
}); | ||
}); | ||
formatter.on('end', function (event) { | ||
var allHintCount = event.allHintCount; | ||
if (allHintCount > 0) { | ||
console.log(''); | ||
var message = '%d problems'; | ||
console.log(nocolor ? message : message.red, event.allHintCount); | ||
} | ||
}); | ||
}; | ||
module.exports = unixFormatter; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidW5peC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9iaW4vZm9ybWF0dGVycy91bml4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBRUEsSUFBTSxhQUFhLEdBQXNCLFVBQ3ZDLFNBQVMsRUFDVCxRQUFRLEVBQ1IsT0FBTztJQUVQLElBQU0sT0FBTyxHQUFHLE9BQU8sQ0FBQyxPQUFPLENBQUE7SUFDL0IsU0FBUyxDQUFDLEVBQUUsQ0FBQyxNQUFNLEVBQUUsVUFBQyxLQUFLO1FBQ3pCLEtBQUssQ0FBQyxRQUFRLENBQUMsT0FBTyxDQUFDLFVBQUMsT0FBTztZQUM3QixPQUFPLENBQUMsR0FBRyxDQUNUO2dCQUNFLEtBQUssQ0FBQyxJQUFJO2dCQUNWLE9BQU8sQ0FBQyxJQUFJO2dCQUNaLE9BQU8sQ0FBQyxHQUFHO2dCQUNYLE1BQUksT0FBTyxDQUFDLE9BQU8sVUFBSyxPQUFPLENBQUMsSUFBSSxTQUFJLE9BQU8sQ0FBQyxJQUFJLENBQUMsRUFBRSxNQUFHO2FBQzNELENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUNaLENBQUE7UUFDSCxDQUFDLENBQUMsQ0FBQTtJQUNKLENBQUMsQ0FBQyxDQUFBO0lBRUYsU0FBUyxDQUFDLEVBQUUsQ0FBQyxLQUFLLEVBQUUsVUFBQyxLQUFLO1FBQ3hCLElBQU0sWUFBWSxHQUFHLEtBQUssQ0FBQyxZQUFZLENBQUE7UUFDdkMsSUFBSSxZQUFZLEdBQUcsQ0FBQyxFQUFFO1lBQ3BCLE9BQU8sQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLENBQUE7WUFDZixJQUFNLE9BQU8sR0FBRyxhQUFhLENBQUE7WUFDN0IsT0FBTyxDQUFDLEdBQUcsQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUMsT0FBTyxDQUFDLEdBQUcsRUFBRSxLQUFLLENBQUMsWUFBWSxDQUFDLENBQUE7U0FDakU7SUFDSCxDQUFDLENBQUMsQ0FBQTtBQUNKLENBQUMsQ0FBQTtBQUVELE1BQU0sQ0FBQyxPQUFPLEdBQUcsYUFBYSxDQUFBIn0= |
@@ -0,1 +1,15 @@ | ||
## [0.13.1-beta.1](https://github.com/htmlhint/HTMLHint/compare/v0.13.0...v0.13.1-beta.1) (2020-05-30) | ||
### Bug Fixes | ||
* add missing branches to action release ([#425](https://github.com/htmlhint/HTMLHint/issues/425)) ([62c2f3c](https://github.com/htmlhint/HTMLHint/commit/62c2f3c4dbc31235f644da42b1eeccd8d73c83aa)) | ||
* add missing plugins for docusaurus ([#402](https://github.com/htmlhint/HTMLHint/issues/402)) ([d9ef347](https://github.com/htmlhint/HTMLHint/commit/d9ef3476bfb935314a38dabfbd5ad055deec7b6a)) | ||
* correctly call hint queue drain ([#409](https://github.com/htmlhint/HTMLHint/issues/409)) ([7b63cb2](https://github.com/htmlhint/HTMLHint/commit/7b63cb282dc41c8757913d92aefc11ddcaab6039)) | ||
* dupplicate ga ([#407](https://github.com/htmlhint/HTMLHint/issues/407)) ([506f25a](https://github.com/htmlhint/HTMLHint/commit/506f25a31d52b66ef58a12eb258bed3bf517146b)) | ||
* eslint fix ([820ff8f](https://github.com/htmlhint/HTMLHint/commit/820ff8fe4714bc3ba47565eb58d87910d60934e8)) | ||
* fix url repo pkg ([#413](https://github.com/htmlhint/HTMLHint/issues/413)) ([b7f5786](https://github.com/htmlhint/HTMLHint/commit/b7f5786a803fb2a31c5819b70b608b133f2e1e51)) | ||
* **attr-no-unnecessary-whitespace:** fix when equals symbol in value ([#405](https://github.com/htmlhint/HTMLHint/issues/405)) ([fe4f3c6](https://github.com/htmlhint/HTMLHint/commit/fe4f3c6732d76ec78a19e97d2640e63be3dd6735)) | ||
* github token ([18441f6](https://github.com/htmlhint/HTMLHint/commit/18441f6c54fe540ac86cdedbc61846a2662d78c8)) | ||
# [0.13.0](https://github.com/htmlhint/HTMLHint/compare/v0.12.2...v0.13.0) (2020-05-18) | ||
@@ -2,0 +16,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).HTMLHint={})}(this,(function(e){"use strict";class t{constructor(){this._listeners={},this._mapCdataTags=this.makeMap("script,style"),this._arrBlocks=[],this.lastEvent=null}makeMap(e){for(var t={},a=e.split(","),n=0;n<a.length;n++)t[a[n]]=!0;return t}parse(e){var t,a,n,r,i,s,o,l,u=this,c=u._mapCdataTags,d=/<(?:\/([^\s>]+)\s*|!--([\s\S]*?)--|!([^>]*?)|([\w\-:]+)((?:\s+[^\s"'>\/=\x00-\x0F\x7F\x80-\x9F]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'>]*))?)*?)\s*(\/?))>/g,h=/\s*([^\s"'>\/=\x00-\x0F\x7F\x80-\x9F]+)(?:\s*=\s*(?:(")([^"]*)"|(')([^']*)'|([^\s"'>]*)))?/g,f=/\r?\n/g,g=0,m=0,p=0,v=1,b=u._arrBlocks;function w(e,t,a,n){var r=a-p+1;for(void 0===n&&(n={}),n.raw=t,n.pos=a,n.line=v,n.col=r,b.push(n),u.fire(e,n);f.exec(t);)v++,p=a+f.lastIndex}for(u.fire("start",{pos:0,line:1,col:1});t=d.exec(e);)if((a=t.index)>g&&(l=e.substring(g,a),i?o.push(l):w("text",l,g)),g=d.lastIndex,!(n=t[1])||(i&&n===i&&(w("cdata",l=o.join(""),m,{tagName:i,attrs:s}),i=null,s=null,o=null),i))if(i)o.push(t[0]);else if(n=t[4]){r=[];for(var y,L=t[5],x=0;y=h.exec(L);){var T=y[1],N=y[2]?y[2]:y[4]?y[4]:"",A=y[3]?y[3]:y[5]?y[5]:y[6]?y[6]:"";r.push({name:T,value:A,quote:N,index:y.index,raw:y[0]}),x+=y[0].length}x===L.length?(w("tagstart",t[0],a,{tagName:n,attrs:r,close:t[6]}),c[n]&&(i=n,s=r.concat(),o=[],m=g)):w("text",t[0],a)}else(t[2]||t[3])&&w("comment",t[0],a,{content:t[2]||t[3],long:!!t[2]});else w("tagend",t[0],a,{tagName:n});e.length>g&&w("text",l=e.substring(g,e.length),g),u.fire("end",{pos:g,line:v,col:e.length-p+1})}addListener(e,t){for(var a,n=this._listeners,r=e.split(/[,\s]/),i=0,s=r.length;i<s;i++)void 0===n[a=r[i]]&&(n[a]=[]),n[a].push(t)}fire(e,t){void 0===t&&(t={}),t.type=e;var a=[],n=this._listeners[e],r=this._listeners.all;void 0!==n&&(a=a.concat(n)),void 0!==r&&(a=a.concat(r));var i=this.lastEvent;null!==i&&(delete i.lastEvent,t.lastEvent=i),this.lastEvent=t;for(var s=0,o=a.length;s<o;s++)a[s].call(this,t)}removeListener(e,t){var a=this._listeners[e];if(void 0!==a)for(var n=0,r=a.length;n<r;n++)if(a[n]===t){a.splice(n,1);break}}fixPos(e,t){var a,n=e.raw.substr(0,t).split(/\r?\n/),r=n.length-1,i=e.line;return r>0?(i+=r,a=n[r].length+1):a=e.col+t,{line:i,col:a}}getMapAttrs(e){for(var t,a={},n=0,r=e.length;n<r;n++)a[(t=e[n]).name]=t.value;return a}}class a{constructor(e,t){this.html=e,this.lines=e.split(/\r?\n/);var a=e.match(/\r?\n/);this.brLen=null!==a?a[0].length:0,this.ruleset=t,this.messages=[],this.error=this.report.bind(this,"error"),this.warn=this.report.bind(this,"warning"),this.info=this.report.bind(this,"info")}report(e,t,a,n,r,i){for(var s,o,l=this.lines,u=this.brLen,c=a-1,d=l.length;c<d&&(n>(o=(s=l[c]).length)&&a<d);c++)a++,1!==(n-=o)&&(n-=u);this.messages.push({type:e,message:t,raw:i,evidence:s,line:a,col:n,rule:{id:r.id,description:r.description,link:"https://github.com/thedaviddias/HTMLHint/wiki/"+r.id}})}}function n(e,t){if(t instanceof RegExp)return!!t.test(e)&&{match:e,pattern:t};const a=t[0],n=t[t.length-1],r=t[t.length-2],i="/"===a&&("/"===n||"/"===r&&"i"===n);if(i){return i&&"i"===n?new RegExp(t.slice(1,-2),"i").test(e):new RegExp(t.slice(1,-1)).test(e)}return e===t}var r={id:"attr-lowercase",description:"All attribute names must be in lowercase.",init:function(e,t,a){var r=this,i=Array.isArray(a)?a:[];e.addListener("tagstart",(function(e){for(var a,s=e.attrs,o=e.col+e.tagName.length+1,l=0,u=s.length;l<u;l++){var c=(a=s[l]).name;i.find(e=>n(c,e))||c===c.toLowerCase()||t.error("The attribute name of [ "+c+" ] must be in lowercase.",e.line,o+a.index,r,a.raw)}}))}},i={id:"attr-sorted",description:"Attribute tags must be in proper order.",init:function(e,t){for(var a=this,n={},r=["class","id","name","src","for","type","href","value","title","alt","role"],i=0;i<r.length;i++)n[r[i]]=i;e.addListener("tagstart",(function(e){for(var r=e.attrs,i=[],s=0;s<r.length;s++)i.push(r[s].name);var o=JSON.stringify(i);i.sort((function(e,t){return null==n[e]&&null==n[t]?0:null==n[e]?1:null==n[t]?-1:n[e]-n[t]||e.localeCompare(t)})),o!==JSON.stringify(i)&&t.error("Inaccurate order "+o+" should be in hierarchy "+JSON.stringify(i)+" ",e.line,e.col,a)}))}},s={id:"attr-unsafe-chars",description:"Attribute values cannot contain unsafe chars.",init:function(e,t){var a=this;e.addListener("tagstart",(function(e){for(var n,r,i=e.attrs,s=e.col+e.tagName.length+1,o=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/,l=0,u=i.length;l<u;l++)if(null!==(r=(n=i[l]).value.match(o))){var c=escape(r[0]).replace(/%u/,"\\u").replace(/%/,"\\x");t.warn("The value of attribute [ "+n.name+" ] cannot contain an unsafe char [ "+c+" ].",e.line,s+n.index,a,n.raw)}}))}},o={id:"attr-whitespace",description:"All attributes should be separated by only one space and not have leading/trailing whitespace.",init:function(e,t,a){var n=this,r=Array.isArray(a)?a:[];e.addListener("tagstart",(function(e){var a,i=e.attrs,s=e.col+e.tagName.length+1;i.forEach((function(i){a=i;var o=i.name;-1===r.indexOf(o)&&(i.value.trim(i.value)!==i.value&&t.error("The attributes of [ "+o+" ] must not have trailing whitespace.",e.line,s+a.index,n,a.raw),i.value.replace(/ +(?= )/g,"")!==i.value&&t.error("The attributes of [ "+o+" ] must be separated by only one space.",e.line,s+a.index,n,a.raw))}))}))}},l={id:"id-class-value",description:"The id and class attribute values must meet the specified rules.",init:function(e,t,a){var n,r=this;if((n="string"==typeof a?{underline:{regId:/^[a-z\d]+(_[a-z\d]+)*$/,message:"The id and class attribute values must be in lowercase and split by an underscore."},dash:{regId:/^[a-z\d]+(-[a-z\d]+)*$/,message:"The id and class attribute values must be in lowercase and split by a dash."},hump:{regId:/^[a-z][a-zA-Z\d]*([A-Z][a-zA-Z\d]*)*$/,message:"The id and class attribute values must meet the camelCase style."}}[a]:a)&&n.regId){var i=n.regId,s=n.message;i instanceof RegExp||(i=new RegExp(i)),e.addListener("tagstart",(function(e){for(var a,n=e.attrs,o=e.col+e.tagName.length+1,l=0,u=n.length;l<u;l++)if("id"===(a=n[l]).name.toLowerCase()&&!1===i.test(a.value)&&t.warn(s,e.line,o+a.index,r,a.raw),"class"===a.name.toLowerCase())for(var c,d=a.value.split(/\s+/g),h=0,f=d.length;h<f;h++)(c=d[h])&&!1===i.test(c)&&t.warn(s,e.line,o+a.index,r,c)}))}}},u={id:"id-unique",description:"The value of id attributes must be unique.",init:function(e,t){var a=this,n={};e.addListener("tagstart",(function(e){for(var r,i,s=e.attrs,o=e.col+e.tagName.length+1,l=0,u=s.length;l<u;l++)if("id"===(r=s[l]).name.toLowerCase()){(i=r.value)&&(void 0===n[i]?n[i]=1:n[i]++,n[i]>1&&t.error("The id value [ "+i+" ] must be unique.",e.line,o+r.index,a,r.raw));break}}))}},c={id:"space-tab-mixed-disabled",description:"Do not mix tabs and spaces for indentation.",init:function(e,t,a){var n=this,r="nomix",i=null;if("string"==typeof a){var s=a.match(/^([a-z]+)(\d+)?/);r=s[1],i=s[2]&&parseInt(s[2],10)}e.addListener("text",(function(a){for(var s,o=a.raw,l=/(^|\r?\n)([ \t]+)/g;s=l.exec(o);){var u=e.fixPos(a,s.index+s[1].length);if(1===u.col){var c=s[2];"space"===r?i?!1!==/^ +$/.test(c)&&c.length%i==0||t.warn("Please use space for indentation and keep "+i+" length.",u.line,1,n,a.raw):!1===/^ +$/.test(c)&&t.warn("Please use space for indentation.",u.line,1,n,a.raw):"tab"===r&&!1===/^\t+$/.test(c)?t.warn("Please use tab for indentation.",u.line,1,n,a.raw):!0===/ +\t|\t+ /.test(c)&&t.warn("Do not mix tabs and spaces for indentation.",u.line,1,n,a.raw)}}}))}},d={id:"tag-pair",description:"Tag must be paired.",init:function(e,t){var a=this,n=[],r=e.makeMap("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,track,command,source,keygen,wbr");e.addListener("tagstart",(function(e){var t=e.tagName.toLowerCase();void 0!==r[t]||e.close||n.push({tagName:t,line:e.line,raw:e.raw})})),e.addListener("tagend",(function(e){for(var r=e.tagName.toLowerCase(),i=n.length-1;i>=0&&n[i].tagName!==r;i--);if(i>=0){for(var s=[],o=n.length-1;o>i;o--)s.push("</"+n[o].tagName+">");if(s.length>0){var l=n[n.length-1];t.error("Tag must be paired, missing: [ "+s.join("")+" ], start tag match failed [ "+l.raw+" ] on line "+l.line+".",e.line,e.col,a,e.raw)}n.length=i}else t.error("Tag must be paired, no start tag: [ "+e.raw+" ]",e.line,e.col,a,e.raw)})),e.addListener("end",(function(e){for(var r=[],i=n.length-1;i>=0;i--)r.push("</"+n[i].tagName+">");if(r.length>0){var s=n[n.length-1];t.error("Tag must be paired, missing: [ "+r.join("")+" ], open tag match failed [ "+s.raw+" ] on line "+s.line+".",e.line,e.col,a,"")}}))}},h={id:"tag-self-close",description:"Empty tags must be self closed.",init:function(e,t){var a=this,n=e.makeMap("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,track,command,source,keygen,wbr");e.addListener("tagstart",(function(e){var r=e.tagName.toLowerCase();void 0!==n[r]&&(e.close||t.warn("The empty tag : [ "+r+" ] must be self closed.",e.line,e.col,a,e.raw))}))}},f={id:"tagname-lowercase",description:"All html element names must be in lowercase.",init:function(e,t,a){var n=this,r=Array.isArray(a)?a:[];e.addListener("tagstart,tagend",(function(e){var a=e.tagName;-1===r.indexOf(a)&&a!==a.toLowerCase()&&t.error("The html element name of [ "+a+" ] must be in lowercase.",e.line,e.col,n,e.raw)}))}},g={a:{selfclosing:!1,attrsRequired:["href","title"],redundantAttrs:["alt"]},div:{selfclosing:!1},main:{selfclosing:!1,redundantAttrs:["role"]},nav:{selfclosing:!1,redundantAttrs:["role"]},script:{attrsOptional:[["async","async"],["defer","defer"]]},img:{selfclosing:!0,attrsRequired:["src","alt","title"]}},m={id:"tags-check",description:"Checks html tags.",init:function(e,t,a){var n=this;"boolean"!=typeof a&&function(e){for(var t,a=1;a<arguments.length;a++)for(var n in t=arguments[a])e[n]=t[n]}(g,a),e.addListener("tagstart",(function(e){var a=e.attrs,r=e.col+e.tagName.length+1,i=e.tagName.toLowerCase();if(g[i]){var s=g[i];!0!==s.selfclosing||e.close?!1===s.selfclosing&&e.close&&t.warn("The <"+i+"> tag must not be selfclosing.",e.line,e.col,n,e.raw):t.warn("The <"+i+"> tag must be selfclosing.",e.line,e.col,n,e.raw),s.attrsRequired&&s.attrsRequired.forEach((function(s){if(Array.isArray(s)){var o=s.map((function(e){return e})),l=o.shift(),u=o;a.some((function(e){return e.name===l}))?a.forEach((function(a){a.name===l&&-1===u.indexOf(a.value)&&t.error("The <"+i+"> tag must have attr '"+l+"' with one value of '"+u.join("' or '")+"'.",e.line,r,n,e.raw)})):t.error("The <"+i+"> tag must have attr '"+l+"'.",e.line,r,n,e.raw)}else a.some((function(e){return-1!==s.split("|").indexOf(e.name)}))||t.error("The <"+i+"> tag must have attr '"+s+"'.",e.line,r,n,e.raw)})),s.attrsOptional&&s.attrsOptional.forEach((function(s){if(Array.isArray(s)){var o=s.map((function(e){return e})),l=o.shift(),u=o;a.some((function(e){return e.name===l}))&&a.forEach((function(a){a.name===l&&-1===u.indexOf(a.value)&&t.error("The <"+i+"> tag must have optional attr '"+l+"' with one value of '"+u.join("' or '")+"'.",e.line,r,n,e.raw)}))}})),s.redundantAttrs&&s.redundantAttrs.forEach((function(s){a.some((function(e){return e.name===s}))&&t.error("The attr '"+s+"' is redundant for <"+i+"> and should be ommited.",e.line,r,n,e.raw)}))}}))}},p={id:"attr-no-unnecessary-whitespace",description:"No spaces between attribute names and values.",init:function(e,t,a){var n=this,r=Array.isArray(a)?a:[];e.addListener("tagstart",(function(e){for(var a=e.attrs,i=e.col+e.tagName.length+1,s=0;s<a.length;s++)-1===r.indexOf(a[s].name)&&/[^=](\s+=\s+|=\s+|\s+=)/g.test(a[s].raw.trim())&&t.error("The attribute '"+a[s].name+"' must not have spaces between the name and value.",e.line,i+a[s].index,n,a[s].raw)}))}},v=Object.freeze({__proto__:null,altRequire:{id:"alt-require",description:"The alt attribute of an <img> element must be present and alt attribute of area[href] and input[type=image] must have a value.",init:function(e,t){var a=this;e.addListener("tagstart",(function(n){var r,i=n.tagName.toLowerCase(),s=e.getMapAttrs(n.attrs),o=n.col+i.length+1;"img"!==i||"alt"in s?("area"===i&&"href"in s||"input"===i&&"image"===s.type)&&("alt"in s&&""!==s.alt||(r="area"===i?"area[href]":"input[type=image]",t.warn("The alt attribute of "+r+" must have a value.",n.line,o,a,n.raw))):t.warn("An alt attribute must be present on <img> elements.",n.line,o,a,n.raw)}))}},attrLowercase:r,attrSort:i,attrNoDuplication:{id:"attr-no-duplication",description:"Elements cannot have duplicate attributes.",init:function(e,t){var a=this;e.addListener("tagstart",(function(e){for(var n,r,i=e.attrs,s=e.col+e.tagName.length+1,o={},l=0,u=i.length;l<u;l++)!0===o[r=(n=i[l]).name]&&t.error("Duplicate of attribute name [ "+n.name+" ] was found.",e.line,s+n.index,a,n.raw),o[r]=!0}))}},attrUnsafeChars:s,attrValueDoubleQuotes:{id:"attr-value-double-quotes",description:"Attribute values must be in double quotes.",init:function(e,t){var a=this;e.addListener("tagstart",(function(e){for(var n,r=e.attrs,i=e.col+e.tagName.length+1,s=0,o=r.length;s<o;s++)(""!==(n=r[s]).value&&'"'!==n.quote||""===n.value&&"'"===n.quote)&&t.error("The value of attribute [ "+n.name+" ] must be in double quotes.",e.line,i+n.index,a,n.raw)}))}},attrValueNotEmpty:{id:"attr-value-not-empty",description:"All attributes must have values.",init:function(e,t){var a=this;e.addListener("tagstart",(function(e){for(var n,r=e.attrs,i=e.col+e.tagName.length+1,s=0,o=r.length;s<o;s++)""===(n=r[s]).quote&&""===n.value&&t.warn("The attribute [ "+n.name+" ] must have a value.",e.line,i+n.index,a,n.raw)}))}},attrValueSingleQuotes:{id:"attr-value-single-quotes",description:"Attribute values must be in single quotes.",init:function(e,t){var a=this;e.addListener("tagstart",(function(e){for(var n,r=e.attrs,i=e.col+e.tagName.length+1,s=0,o=r.length;s<o;s++)(""!==(n=r[s]).value&&"'"!==n.quote||""===n.value&&'"'===n.quote)&&t.error("The value of attribute [ "+n.name+" ] must be in single quotes.",e.line,i+n.index,a,n.raw)}))}},attrWhitespace:o,doctypeFirst:{id:"doctype-first",description:"Doctype must be declared first.",init:function(e,t){var a=this,n=function(r){"start"===r.type||"text"===r.type&&/^\s*$/.test(r.raw)||(("comment"!==r.type&&!1===r.long||!1===/^DOCTYPE\s+/i.test(r.content))&&t.error("Doctype must be declared first.",r.line,r.col,a,r.raw),e.removeListener("all",n))};e.addListener("all",n)}},doctypeHTML5:{id:"doctype-html5",description:'Invalid doctype. Use: "<!DOCTYPE html>"',init:function(e,t){var a=this;function n(e){!1===e.long&&"doctype html"!==e.content.toLowerCase()&&t.warn('Invalid doctype. Use: "<!DOCTYPE html>"',e.line,e.col,a,e.raw)}e.addListener("all",n),e.addListener("tagstart",(function t(){e.removeListener("comment",n),e.removeListener("tagstart",t)}))}},headScriptDisabled:{id:"head-script-disabled",description:"The <script> tag cannot be used in a <head> tag.",init:function(e,t){var a=this,n=/^(text\/javascript|application\/javascript)$/i,r=!1;function i(i){var s=e.getMapAttrs(i.attrs).type,o=i.tagName.toLowerCase();"head"===o&&(r=!0),!0!==r||"script"!==o||s&&!0!==n.test(s)||t.warn("The <script> tag cannot be used in a <head> tag.",i.line,i.col,a,i.raw)}e.addListener("tagstart",i),e.addListener("tagend",(function t(a){"head"===a.tagName.toLowerCase()&&(e.removeListener("tagstart",i),e.removeListener("tagend",t))}))}},hrefAbsOrRel:{id:"href-abs-or-rel",description:"An href attribute must be either absolute or relative.",init:function(e,t,a){var n=this,r="abs"===a?"absolute":"relative";e.addListener("tagstart",(function(e){for(var a,i=e.attrs,s=e.col+e.tagName.length+1,o=0,l=i.length;o<l;o++)if("href"===(a=i[o]).name){("absolute"===r&&!1===/^\w+?:/.test(a.value)||"relative"===r&&!0===/^https?:\/\//.test(a.value))&&t.warn("The value of the href attribute [ "+a.value+" ] must be "+r+".",e.line,s+a.index,n,a.raw);break}}))}},idClsasAdDisabled:{id:"id-class-ad-disabled",description:"The id and class attributes cannot use the ad keyword, it will be blocked by adblock software.",init:function(e,t){var a=this;e.addListener("tagstart",(function(e){for(var n,r,i=e.attrs,s=e.col+e.tagName.length+1,o=0,l=i.length;o<l;o++)r=(n=i[o]).name,/^(id|class)$/i.test(r)&&/(^|[-_])ad([-_]|$)/i.test(n.value)&&t.warn("The value of attribute "+r+" cannot use the ad keyword.",e.line,s+n.index,a,n.raw)}))}},idClassValue:l,idUnique:u,inlineScriptDisabled:{id:"inline-script-disabled",description:"Inline script cannot be used.",init:function(e,t){var a=this;e.addListener("tagstart",(function(e){for(var n,r,i=e.attrs,s=e.col+e.tagName.length+1,o=/^on(unload|message|submit|select|scroll|resize|mouseover|mouseout|mousemove|mouseleave|mouseenter|mousedown|load|keyup|keypress|keydown|focus|dblclick|click|change|blur|error)$/i,l=0,u=i.length;l<u;l++)r=(n=i[l]).name.toLowerCase(),!0===o.test(r)?t.warn("Inline script [ "+n.raw+" ] cannot be used.",e.line,s+n.index,a,n.raw):"src"!==r&&"href"!==r||/^\s*javascript:/i.test(n.value)&&t.warn("Inline script [ "+n.raw+" ] cannot be used.",e.line,s+n.index,a,n.raw)}))}},inlineStyleDisabled:{id:"inline-style-disabled",description:"Inline style cannot be used.",init:function(e,t){var a=this;e.addListener("tagstart",(function(e){for(var n,r=e.attrs,i=e.col+e.tagName.length+1,s=0,o=r.length;s<o;s++)"style"===(n=r[s]).name.toLowerCase()&&t.warn("Inline style [ "+n.raw+" ] cannot be used.",e.line,i+n.index,a,n.raw)}))}},inputRequiresLabel:{id:"input-requires-label",description:"All [ input ] tags must have a corresponding [ label ] tag. ",init:function(e,t){var a=this,n=[],r=[];e.addListener("tagstart",(function(t){var a=t.tagName.toLowerCase(),i=e.getMapAttrs(t.attrs),s=t.col+a.length+1;"input"===a&&r.push({event:t,col:s,id:i.id}),"label"===a&&"for"in i&&""!==i.for&&n.push({event:t,col:s,forValue:i.for})})),e.addListener("end",(function(){r.forEach((function(e){(function(e){var t=!1;return n.forEach((function(a){e.id&&e.id===a.forValue&&(t=!0)})),t})(e)||t.warn("No matching [ label ] tag found.",e.event.line,e.col,a,e.event.raw)}))}))}},scriptDisabled:{id:"script-disabled",description:"The <script> tag cannot be used.",init:function(e,t){var a=this;e.addListener("tagstart",(function(e){"script"===e.tagName.toLowerCase()&&t.error("The <script> tag cannot be used.",e.line,e.col,a,e.raw)}))}},spaceTabMixedDisabled:c,specCharEscape:{id:"spec-char-escape",description:"Special characters must be escaped.",init:function(e,t){var a=this;e.addListener("text",(function(n){for(var r,i=n.raw,s=/([<>])|( \& )/g;r=s.exec(i);){var o=e.fixPos(n,r.index);t.error("Special characters must be escaped : [ "+r[0]+" ].",o.line,o.col,a,n.raw)}}))}},srcNotEmpty:{id:"src-not-empty",description:"The src attribute of an img(script,link) must have a value.",init:function(e,t){var a=this;e.addListener("tagstart",(function(e){for(var n,r=e.tagName,i=e.attrs,s=e.col+r.length+1,o=0,l=i.length;o<l;o++)n=i[o],(!0===/^(img|script|embed|bgsound|iframe)$/.test(r)&&"src"===n.name||"link"===r&&"href"===n.name||"object"===r&&"data"===n.name)&&""===n.value&&t.error("The attribute [ "+n.name+" ] of the tag [ "+r+" ] must have a value.",e.line,s+n.index,a,n.raw)}))}},styleDisabled:{id:"style-disabled",description:"<style> tags cannot be used.",init:function(e,t){var a=this;e.addListener("tagstart",(function(e){"style"===e.tagName.toLowerCase()&&t.warn("The <style> tag cannot be used.",e.line,e.col,a,e.raw)}))}},tagPair:d,tagSelfClose:h,tagnameLowercase:f,tagnameSpecialChars:{id:"tagname-specialchars",description:"All html element names must be in lowercase.",init:function(e,t){var a=this,n=/[^a-zA-Z0-9\-:_]/;e.addListener("tagstart,tagend",(function(e){var r=e.tagName;n.test(r)&&t.error("The html element name of [ "+r+" ] contains special character.",e.line,e.col,a,e.raw)}))}},titleRequire:{id:"title-require",description:"<title> must be present in <head> tag.",init:function(e,t){var a=this,n=!1,r=!1;function i(e){var t=e.tagName.toLowerCase();"head"===t?n=!0:"title"===t&&n&&(r=!0)}e.addListener("tagstart",i),e.addListener("tagend",(function n(s){var o=s.tagName.toLowerCase();if(r&&"title"===o){var l=s.lastEvent;("text"!==l.type||"text"===l.type&&!0===/^\s*$/.test(l.raw))&&t.error("<title></title> must not be empty.",s.line,s.col,a,s.raw)}else"head"===o&&(!1===r&&t.error("<title> must be present in <head> tag.",s.line,s.col,a,s.raw),e.removeListener("tagstart",i),e.removeListener("tagend",n))}))}},tagsCheck:m,attrNoUnnecessaryWhitespace:p});function b(e,t){return new Array(e+1).join(t||" ")}const w=new class{constructor(){this.rules={},this.defaultRuleset={"tagname-lowercase":!0,"attr-lowercase":!0,"attr-value-double-quotes":!0,"doctype-first":!0,"tag-pair":!0,"spec-char-escape":!0,"id-unique":!0,"src-not-empty":!0,"attr-no-duplication":!0,"title-require":!0}}addRule(e){this.rules[e.id]=e}verify(e,n){void 0!==n&&0!==Object.keys(n).length||(n=this.defaultRuleset),e=e.replace(/^\s*<!--\s*htmlhint\s+([^\r\n]+?)\s*-->/i,(function(e,t){return void 0===n&&(n={}),t.replace(/(?:^|,)\s*([^:,]+)\s*(?:\:\s*([^,\s]+))?/g,(function(e,t,a){"false"===a?a=!1:"true"===a&&(a=!0),n[t]=void 0===a||a})),""}));var r,i=new t,s=new a(e,n),o=this.rules;for(var l in n)void 0!==(r=o[l])&&!1!==n[l]&&r.init(i,s,n[l]);return i.parse(e),s.messages}format(e,t){var a=[],n={white:"",grey:"",red:"",reset:""};(t=t||{}).colors&&(n.white="[37m",n.grey="[90m",n.red="[31m",n.reset="[39m");var r=t.indent||0;return e.forEach(e=>{var t=e.evidence,i=e.line,s=e.col,o=t.length,l=s>41?s-40:1,u=t.length>s+60?s+60:o;s<41&&(u+=40-s+1),t=t.replace(/\t/g," ").substring(l-1,u),l>1&&(t="..."+t,l-=3),u<o&&(t+="..."),a.push(n.white+b(r)+"L"+i+" |"+n.grey+t+n.reset);var c=s-l,d=t.substring(0,c).match(/[^\u0000-\u00ff]/g);null!==d&&(c+=d.length),a.push(n.white+b(r)+b(String(i).length+3+c)+"^ "+n.red+e.message+" ("+e.rule.id+")"+n.reset)}),a}};Object.keys(v).forEach(e=>{w.addRule(v[e])}),e.HTMLHint=w,e.HTMLParser=t,e.HTMLRules=v,e.Reporter=a,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).HTMLHint={})}(this,(function(e){"use strict";function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function a(e,t){return e(t={exports:{}},t.exports),t.exports}var n=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(){this._listeners={},this._mapCdataTags=this.makeMap("script,style"),this._arrBlocks=[],this.lastEvent=null}return e.prototype.makeMap=function(e){for(var t={},a=e.split(","),n=0;n<a.length;n++)t[a[n]]=!0;return t},e.prototype.parse=function(e){var t,a,n,r,i,s,o,l,u=this,d=this._mapCdataTags,c=/<(?:\/([^\s>]+)\s*|!--([\s\S]*?)--|!([^>]*?)|([\w\-:]+)((?:\s+[^\s"'>\/=\x00-\x0F\x7F\x80-\x9F]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'>]*))?)*?)\s*(\/?))>/g,f=/\s*([^\s"'>\/=\x00-\x0F\x7F\x80-\x9F]+)(?:\s*=\s*(?:(")([^"]*)"|(')([^']*)'|([^\s"'>]*)))?/g,p=/\r?\n/g,h=0,g=0,v=0,m=1,b=this._arrBlocks;this.fire("start",{pos:0,line:1,col:1});for(var y=function(e,t,a,n){var r=a-v+1;for(void 0===n&&(n={}),n.raw=t,n.pos=a,n.line=m,n.col=r,b.push(n),u.fire(e,n);p.exec(t);)m++,v=a+p.lastIndex};t=c.exec(e);)if((a=t.index)>h&&(l=e.substring(h,a),i?o.push(l):y("text",l,h)),h=c.lastIndex,!(n=t[1])||(i&&n===i&&(y("cdata",l=o.join(""),g,{tagName:i,attrs:s}),i=null,s=null,o=null),i))if(i)o.push(t[0]);else if(n=t[4]){r=[];for(var w=t[5],L=void 0,O=0;L=f.exec(w);){var _=L[1],P=L[2]?L[2]:L[4]?L[4]:"",j=L[3]?L[3]:L[5]?L[5]:L[6]?L[6]:"";r.push({name:_,value:j,quote:P,index:L.index,raw:L[0]}),O+=L[0].length}O===w.length?(y("tagstart",t[0],a,{tagName:n,attrs:r,close:t[6]}),d[n]&&(i=n,s=r.concat(),o=[],g=h)):y("text",t[0],a)}else(t[2]||t[3])&&y("comment",t[0],a,{content:t[2]||t[3],long:!!t[2]});else y("tagend",t[0],a,{tagName:n});e.length>h&&y("text",l=e.substring(h,e.length),h),this.fire("end",{pos:h,line:m,col:e.length-v+1})},e.prototype.addListener=function(e,t){for(var a,n=this._listeners,r=e.split(/[,\s]/),i=0,s=r.length;i<s;i++)void 0===n[a=r[i]]&&(n[a]=[]),n[a].push(t)},e.prototype.fire=function(e,t){void 0===t&&(t={}),t.type=e;var a=[],n=this._listeners[e],r=this._listeners.all;void 0!==n&&(a=a.concat(n)),void 0!==r&&(a=a.concat(r));var i=this.lastEvent;null!==i&&(delete i.lastEvent,t.lastEvent=i),this.lastEvent=t;for(var s=0,o=a.length;s<o;s++)a[s].call(this,t)},e.prototype.removeListener=function(e,t){var a=this._listeners[e];if(void 0!==a)for(var n=0,r=a.length;n<r;n++)if(a[n]===t){a.splice(n,1);break}},e.prototype.fixPos=function(e,t){var a,n=e.raw.substr(0,t).split(/\r?\n/),r=n.length-1,i=e.line;return r>0?(i+=r,a=n[r].length+1):a=e.col+t,{line:i,col:a}},e.prototype.getMapAttrs=function(e){for(var t,a={},n=0,r=e.length;n<r;n++)a[(t=e[n]).name]=t.value;return a},e}();t.default=a}));t(n);var r=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){this.html=e,this.lines=e.split(/\r?\n/);var a=e.match(/\r?\n/);this.brLen=null!==a?a[0].length:0,this.ruleset=t,this.messages=[],this.error=this.report.bind(this,"error"),this.warn=this.report.bind(this,"warning"),this.info=this.report.bind(this,"info")}return e.prototype.report=function(e,t,a,n,r,i){for(var s,o,l=this.lines,u=this.brLen,d=a-1,c=l.length;d<c&&(n>(o=(s=l[d]).length)&&a<c);d++)a++,1!==(n-=o)&&(n-=u);this.messages.push({type:e,message:t,raw:i,evidence:s,line:a,col:n,rule:{id:r.id,description:r.description,link:"https://github.com/thedaviddias/HTMLHint/wiki/"+r.id}})},e}();t.default=a}));t(r);var i=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"alt-require",description:"The alt attribute of an <img> element must be present and alt attribute of area[href] and input[type=image] must have a value.",init:function(e,t){var a=this;e.addListener("tagstart",(function(n){var r,i=n.tagName.toLowerCase(),s=e.getMapAttrs(n.attrs),o=n.col+i.length+1;"img"!==i||"alt"in s?("area"===i&&"href"in s||"input"===i&&"image"===s.type)&&("alt"in s&&""!==s.alt||(r="area"===i?"area[href]":"input[type=image]",t.warn("The alt attribute of "+r+" must have a value.",n.line,o,a,n.raw))):t.warn("An alt attribute must be present on <img> elements.",n.line,o,a,n.raw)}))}}}));t(i);var s=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"attr-lowercase",description:"All attribute names must be in lowercase.",init:function(e,t,a){var n=this,r=Array.isArray(a)?a:[];e.addListener("tagstart",(function(e){for(var a,i=e.attrs,s=e.col+e.tagName.length+1,o=function(o,l){var u=(a=i[o]).name;r.find((function(e){return function(e,t){if(t instanceof RegExp)return!!t.test(e)&&{match:e,pattern:t};var a=t[0],n=t[t.length-1],r=t[t.length-2],i="/"===a&&("/"===n||"/"===r&&"i"===n);return i?i&&"i"===n?new RegExp(t.slice(1,-2),"i").test(e):new RegExp(t.slice(1,-1)).test(e):e===t}(u,e)}))||u===u.toLowerCase()||t.error("The attribute name of [ "+u+" ] must be in lowercase.",e.line,s+a.index,n,a.raw)},l=0,u=i.length;l<u;l++)o(l)}))}}}));t(s);var o=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"attr-sorted",description:"Attribute tags must be in proper order.",init:function(e,t){for(var a=this,n={},r=["class","id","name","src","for","type","href","value","title","alt","role"],i=0;i<r.length;i++)n[r[i]]=i;e.addListener("tagstart",(function(e){for(var r=e.attrs,i=[],s=0;s<r.length;s++)i.push(r[s].name);var o=JSON.stringify(i);i.sort((function(e,t){return null==n[e]&&null==n[t]?0:null==n[e]?1:null==n[t]?-1:n[e]-n[t]||e.localeCompare(t)})),o!==JSON.stringify(i)&&t.error("Inaccurate order "+o+" should be in hierarchy "+JSON.stringify(i)+" ",e.line,e.col,a)}))}}}));t(o);var l=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"attr-no-duplication",description:"Elements cannot have duplicate attributes.",init:function(e,t){var a=this;e.addListener("tagstart",(function(e){for(var n,r,i=e.attrs,s=e.col+e.tagName.length+1,o={},l=0,u=i.length;l<u;l++)!0===o[r=(n=i[l]).name]&&t.error("Duplicate of attribute name [ "+n.name+" ] was found.",e.line,s+n.index,a,n.raw),o[r]=!0}))}}}));t(l);var u=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"attr-unsafe-chars",description:"Attribute values cannot contain unsafe chars.",init:function(e,t){var a=this;e.addListener("tagstart",(function(e){for(var n,r,i=e.attrs,s=e.col+e.tagName.length+1,o=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/,l=0,u=i.length;l<u;l++)if(null!==(r=(n=i[l]).value.match(o))){var d=escape(r[0]).replace(/%u/,"\\u").replace(/%/,"\\x");t.warn("The value of attribute [ "+n.name+" ] cannot contain an unsafe char [ "+d+" ].",e.line,s+n.index,a,n.raw)}}))}}}));t(u);var d=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"attr-value-double-quotes",description:"Attribute values must be in double quotes.",init:function(e,t){var a=this;e.addListener("tagstart",(function(e){for(var n,r=e.attrs,i=e.col+e.tagName.length+1,s=0,o=r.length;s<o;s++)(""!==(n=r[s]).value&&'"'!==n.quote||""===n.value&&"'"===n.quote)&&t.error("The value of attribute [ "+n.name+" ] must be in double quotes.",e.line,i+n.index,a,n.raw)}))}}}));t(d);var c=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"attr-value-not-empty",description:"All attributes must have values.",init:function(e,t){var a=this;e.addListener("tagstart",(function(e){for(var n,r=e.attrs,i=e.col+e.tagName.length+1,s=0,o=r.length;s<o;s++)""===(n=r[s]).quote&&""===n.value&&t.warn("The attribute [ "+n.name+" ] must have a value.",e.line,i+n.index,a,n.raw)}))}}}));t(c);var f=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"attr-value-single-quotes",description:"Attribute values must be in single quotes.",init:function(e,t){var a=this;e.addListener("tagstart",(function(e){for(var n,r=e.attrs,i=e.col+e.tagName.length+1,s=0,o=r.length;s<o;s++)(""!==(n=r[s]).value&&"'"!==n.quote||""===n.value&&'"'===n.quote)&&t.error("The value of attribute [ "+n.name+" ] must be in single quotes.",e.line,i+n.index,a,n.raw)}))}}}));t(f);var p=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"attr-whitespace",description:"All attributes should be separated by only one space and not have leading/trailing whitespace.",init:function(e,t,a){var n=this,r=Array.isArray(a)?a:[];e.addListener("tagstart",(function(e){var a,i=e.attrs,s=e.col+e.tagName.length+1;i.forEach((function(i){a=i;var o=i.name;-1===r.indexOf(o)&&(i.value.trim(i.value)!==i.value&&t.error("The attributes of [ "+o+" ] must not have trailing whitespace.",e.line,s+a.index,n,a.raw),i.value.replace(/ +(?= )/g,"")!==i.value&&t.error("The attributes of [ "+o+" ] must be separated by only one space.",e.line,s+a.index,n,a.raw))}))}))}}}));t(p);var h=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"doctype-first",description:"Doctype must be declared first.",init:function(e,t){var a=this,n=function(r){"start"===r.type||"text"===r.type&&/^\s*$/.test(r.raw)||(("comment"!==r.type&&!1===r.long||!1===/^DOCTYPE\s+/i.test(r.content))&&t.error("Doctype must be declared first.",r.line,r.col,a,r.raw),e.removeListener("all",n))};e.addListener("all",n)}}}));t(h);var g=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"doctype-html5",description:'Invalid doctype. Use: "<!DOCTYPE html>"',init:function(e,t){var a=this,n=function(e){!1===e.long&&"doctype html"!==e.content.toLowerCase()&&t.warn('Invalid doctype. Use: "<!DOCTYPE html>"',e.line,e.col,a,e.raw)},r=function(){e.removeListener("comment",n),e.removeListener("tagstart",r)};e.addListener("all",n),e.addListener("tagstart",r)}}}));t(g);var v=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"head-script-disabled",description:"The <script> tag cannot be used in a <head> tag.",init:function(e,t){var a=this,n=/^(text\/javascript|application\/javascript)$/i,r=!1,i=function(i){var s=e.getMapAttrs(i.attrs).type,o=i.tagName.toLowerCase();"head"===o&&(r=!0),!0!==r||"script"!==o||s&&!0!==n.test(s)||t.warn("The <script> tag cannot be used in a <head> tag.",i.line,i.col,a,i.raw)},s=function(t){"head"===t.tagName.toLowerCase()&&(e.removeListener("tagstart",i),e.removeListener("tagend",s))};e.addListener("tagstart",i),e.addListener("tagend",s)}}}));t(v);var m=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"href-abs-or-rel",description:"An href attribute must be either absolute or relative.",init:function(e,t,a){var n=this,r="abs"===a?"absolute":"relative";e.addListener("tagstart",(function(e){for(var a,i=e.attrs,s=e.col+e.tagName.length+1,o=0,l=i.length;o<l;o++)if("href"===(a=i[o]).name){("absolute"===r&&!1===/^\w+?:/.test(a.value)||"relative"===r&&!0===/^https?:\/\//.test(a.value))&&t.warn("The value of the href attribute [ "+a.value+" ] must be "+r+".",e.line,s+a.index,n,a.raw);break}}))}}}));t(m);var b=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"id-class-ad-disabled",description:"The id and class attributes cannot use the ad keyword, it will be blocked by adblock software.",init:function(e,t){var a=this;e.addListener("tagstart",(function(e){for(var n,r,i=e.attrs,s=e.col+e.tagName.length+1,o=0,l=i.length;o<l;o++)r=(n=i[o]).name,/^(id|class)$/i.test(r)&&/(^|[-_])ad([-_]|$)/i.test(n.value)&&t.warn("The value of attribute "+r+" cannot use the ad keyword.",e.line,s+n.index,a,n.raw)}))}}}));t(b);var y=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"id-class-value",description:"The id and class attribute values must meet the specified rules.",init:function(e,t,a){var n,r=this;if((n="string"==typeof a?{underline:{regId:/^[a-z\d]+(_[a-z\d]+)*$/,message:"The id and class attribute values must be in lowercase and split by an underscore."},dash:{regId:/^[a-z\d]+(-[a-z\d]+)*$/,message:"The id and class attribute values must be in lowercase and split by a dash."},hump:{regId:/^[a-z][a-zA-Z\d]*([A-Z][a-zA-Z\d]*)*$/,message:"The id and class attribute values must meet the camelCase style."}}[a]:a)&&n.regId){var i=n.regId,s=n.message;i instanceof RegExp||(i=new RegExp(i)),e.addListener("tagstart",(function(e){for(var a,n=e.attrs,o=e.col+e.tagName.length+1,l=0,u=n.length;l<u;l++)if("id"===(a=n[l]).name.toLowerCase()&&!1===i.test(a.value)&&t.warn(s,e.line,o+a.index,r,a.raw),"class"===a.name.toLowerCase())for(var d=a.value.split(/\s+/g),c=void 0,f=0,p=d.length;f<p;f++)(c=d[f])&&!1===i.test(c)&&t.warn(s,e.line,o+a.index,r,c)}))}}}}));t(y);var w=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"id-unique",description:"The value of id attributes must be unique.",init:function(e,t){var a=this,n={};e.addListener("tagstart",(function(e){for(var r,i,s=e.attrs,o=e.col+e.tagName.length+1,l=0,u=s.length;l<u;l++)if("id"===(r=s[l]).name.toLowerCase()){(i=r.value)&&(void 0===n[i]?n[i]=1:n[i]++,n[i]>1&&t.error("The id value [ "+i+" ] must be unique.",e.line,o+r.index,a,r.raw));break}}))}}}));t(w);var L=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"inline-script-disabled",description:"Inline script cannot be used.",init:function(e,t){var a=this;e.addListener("tagstart",(function(e){for(var n,r,i=e.attrs,s=e.col+e.tagName.length+1,o=/^on(unload|message|submit|select|scroll|resize|mouseover|mouseout|mousemove|mouseleave|mouseenter|mousedown|load|keyup|keypress|keydown|focus|dblclick|click|change|blur|error)$/i,l=0,u=i.length;l<u;l++)r=(n=i[l]).name.toLowerCase(),!0===o.test(r)?t.warn("Inline script [ "+n.raw+" ] cannot be used.",e.line,s+n.index,a,n.raw):"src"!==r&&"href"!==r||/^\s*javascript:/i.test(n.value)&&t.warn("Inline script [ "+n.raw+" ] cannot be used.",e.line,s+n.index,a,n.raw)}))}}}));t(L);var O=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"inline-style-disabled",description:"Inline style cannot be used.",init:function(e,t){var a=this;e.addListener("tagstart",(function(e){for(var n,r=e.attrs,i=e.col+e.tagName.length+1,s=0,o=r.length;s<o;s++)"style"===(n=r[s]).name.toLowerCase()&&t.warn("Inline style [ "+n.raw+" ] cannot be used.",e.line,i+n.index,a,n.raw)}))}}}));t(O);var _=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"input-requires-label",description:"All [ input ] tags must have a corresponding [ label ] tag. ",init:function(e,t){var a=this,n=[],r=[];e.addListener("tagstart",(function(t){var a=t.tagName.toLowerCase(),i=e.getMapAttrs(t.attrs),s=t.col+a.length+1;"input"===a&&r.push({event:t,col:s,id:i.id}),"label"===a&&"for"in i&&""!==i.for&&n.push({event:t,col:s,forValue:i.for})})),e.addListener("end",(function(){r.forEach((function(e){(function(e){var t=!1;return n.forEach((function(a){e.id&&e.id===a.forValue&&(t=!0)})),t})(e)||t.warn("No matching [ label ] tag found.",e.event.line,e.col,a,e.event.raw)}))}))}}}));t(_);var P=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"script-disabled",description:"The <script> tag cannot be used.",init:function(e,t){var a=this;e.addListener("tagstart",(function(e){"script"===e.tagName.toLowerCase()&&t.error("The <script> tag cannot be used.",e.line,e.col,a,e.raw)}))}}}));t(P);var j=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"space-tab-mixed-disabled",description:"Do not mix tabs and spaces for indentation.",init:function(e,t,a){var n=this,r="nomix",i=null;if("string"==typeof a){var s=a.match(/^([a-z]+)(\d+)?/);r=s[1],i=s[2]&&parseInt(s[2],10)}e.addListener("text",(function(a){for(var s,o=a.raw,l=/(^|\r?\n)([ \t]+)/g;s=l.exec(o);){var u=e.fixPos(a,s.index+s[1].length);if(1===u.col){var d=s[2];"space"===r?i?!1!==/^ +$/.test(d)&&d.length%i==0||t.warn("Please use space for indentation and keep "+i+" length.",u.line,1,n,a.raw):!1===/^ +$/.test(d)&&t.warn("Please use space for indentation.",u.line,1,n,a.raw):"tab"===r&&!1===/^\t+$/.test(d)?t.warn("Please use tab for indentation.",u.line,1,n,a.raw):!0===/ +\t|\t+ /.test(d)&&t.warn("Do not mix tabs and spaces for indentation.",u.line,1,n,a.raw)}}}))}}}));t(j);var x=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"spec-char-escape",description:"Special characters must be escaped.",init:function(e,t){var a=this;e.addListener("text",(function(n){for(var r,i=n.raw,s=/([<>])|( \& )/g;r=s.exec(i);){var o=e.fixPos(n,r.index);t.error("Special characters must be escaped : [ "+r[0]+" ].",o.line,o.col,a,n.raw)}}))}}}));t(x);var M=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"src-not-empty",description:"The src attribute of an img(script,link) must have a value.",init:function(e,t){var a=this;e.addListener("tagstart",(function(e){for(var n,r=e.tagName,i=e.attrs,s=e.col+r.length+1,o=0,l=i.length;o<l;o++)n=i[o],(!0===/^(img|script|embed|bgsound|iframe)$/.test(r)&&"src"===n.name||"link"===r&&"href"===n.name||"object"===r&&"data"===n.name)&&""===n.value&&t.error("The attribute [ "+n.name+" ] of the tag [ "+r+" ] must have a value.",e.line,s+n.index,a,n.raw)}))}}}));t(M);var T=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"style-disabled",description:"<style> tags cannot be used.",init:function(e,t){var a=this;e.addListener("tagstart",(function(e){"style"===e.tagName.toLowerCase()&&t.warn("The <style> tag cannot be used.",e.line,e.col,a,e.raw)}))}}}));t(T);var N=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"tag-pair",description:"Tag must be paired.",init:function(e,t){var a=this,n=[],r=e.makeMap("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,track,command,source,keygen,wbr");e.addListener("tagstart",(function(e){var t=e.tagName.toLowerCase();void 0!==r[t]||e.close||n.push({tagName:t,line:e.line,raw:e.raw})})),e.addListener("tagend",(function(e){var r,i=e.tagName.toLowerCase();for(r=n.length-1;r>=0&&n[r].tagName!==i;r--);if(r>=0){for(var s=[],o=n.length-1;o>r;o--)s.push("</"+n[o].tagName+">");if(s.length>0){var l=n[n.length-1];t.error("Tag must be paired, missing: [ "+s.join("")+" ], start tag match failed [ "+l.raw+" ] on line "+l.line+".",e.line,e.col,a,e.raw)}n.length=r}else t.error("Tag must be paired, no start tag: [ "+e.raw+" ]",e.line,e.col,a,e.raw)})),e.addListener("end",(function(e){for(var r=[],i=n.length-1;i>=0;i--)r.push("</"+n[i].tagName+">");if(r.length>0){var s=n[n.length-1];t.error("Tag must be paired, missing: [ "+r.join("")+" ], open tag match failed [ "+s.raw+" ] on line "+s.line+".",e.line,e.col,a,"")}}))}}}));t(N);var A=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"tag-self-close",description:"Empty tags must be self closed.",init:function(e,t){var a=this,n=e.makeMap("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,track,command,source,keygen,wbr");e.addListener("tagstart",(function(e){var r=e.tagName.toLowerCase();void 0!==n[r]&&(e.close||t.warn("The empty tag : [ "+r+" ] must be self closed.",e.line,e.col,a,e.raw))}))}}}));t(A);var C=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"tagname-lowercase",description:"All html element names must be in lowercase.",init:function(e,t,a){var n=this,r=Array.isArray(a)?a:[];e.addListener("tagstart,tagend",(function(e){var a=e.tagName;-1===r.indexOf(a)&&a!==a.toLowerCase()&&t.error("The html element name of [ "+a+" ] must be in lowercase.",e.line,e.col,n,e.raw)}))}}}));t(C);var k=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"tagname-specialchars",description:"All html element names must be in lowercase.",init:function(e,t){var a=this,n=/[^a-zA-Z0-9\-:_]/;e.addListener("tagstart,tagend",(function(e){var r=e.tagName;n.test(r)&&t.error("The html element name of [ "+r+" ] contains special character.",e.line,e.col,a,e.raw)}))}}}));t(k);var q=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"title-require",description:"<title> must be present in <head> tag.",init:function(e,t){var a=this,n=!1,r=!1,i=function(e){var t=e.tagName.toLowerCase();"head"===t?n=!0:"title"===t&&n&&(r=!0)},s=function(n){var o=n.tagName.toLowerCase();if(r&&"title"===o){var l=n.lastEvent;("text"!==l.type||"text"===l.type&&!0===/^\s*$/.test(l.raw))&&t.error("<title></title> must not be empty.",n.line,n.col,a,n.raw)}else"head"===o&&(!1===r&&t.error("<title> must be present in <head> tag.",n.line,n.col,a,n.raw),e.removeListener("tagstart",i),e.removeListener("tagend",s))};e.addListener("tagstart",i),e.addListener("tagend",s)}}}));t(q);var E=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var a={a:{selfclosing:!1,attrsRequired:["href","title"],redundantAttrs:["alt"]},div:{selfclosing:!1},main:{selfclosing:!1,redundantAttrs:["role"]},nav:{selfclosing:!1,redundantAttrs:["role"]},script:{attrsOptional:[["async","async"],["defer","defer"]]},img:{selfclosing:!0,attrsRequired:["src","alt","title"]}};t.default={id:"tags-check",description:"Checks html tags.",init:function(e,t,n){var r=this;"boolean"!=typeof n&&function(e){for(var t,a=1;a<arguments.length;a++)for(var n in t=arguments[a])e[n]=t[n]}(a,n),e.addListener("tagstart",(function(e){var n=e.attrs,i=e.col+e.tagName.length+1,s=e.tagName.toLowerCase();if(a[s]){var o=a[s];!0!==o.selfclosing||e.close?!1===o.selfclosing&&e.close&&t.warn("The <"+s+"> tag must not be selfclosing.",e.line,e.col,r,e.raw):t.warn("The <"+s+"> tag must be selfclosing.",e.line,e.col,r,e.raw),o.attrsRequired&&o.attrsRequired.forEach((function(a){if(Array.isArray(a)){var o=a.map((function(e){return e})),l=o.shift(),u=o;n.some((function(e){return e.name===l}))?n.forEach((function(a){a.name===l&&-1===u.indexOf(a.value)&&t.error("The <"+s+"> tag must have attr '"+l+"' with one value of '"+u.join("' or '")+"'.",e.line,i,r,e.raw)})):t.error("The <"+s+"> tag must have attr '"+l+"'.",e.line,i,r,e.raw)}else n.some((function(e){return-1!==a.split("|").indexOf(e.name)}))||t.error("The <"+s+"> tag must have attr '"+a+"'.",e.line,i,r,e.raw)})),o.attrsOptional&&o.attrsOptional.forEach((function(a){if(Array.isArray(a)){var o=a.map((function(e){return e})),l=o.shift(),u=o;n.some((function(e){return e.name===l}))&&n.forEach((function(a){a.name===l&&-1===u.indexOf(a.value)&&t.error("The <"+s+"> tag must have optional attr '"+l+"' with one value of '"+u.join("' or '")+"'.",e.line,i,r,e.raw)}))}})),o.redundantAttrs&&o.redundantAttrs.forEach((function(a){n.some((function(e){return e.name===a}))&&t.error("The attr '"+a+"' is redundant for <"+s+"> and should be ommited.",e.line,i,r,e.raw)}))}}))}}}));t(E);var R=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"attr-no-unnecessary-whitespace",description:"No spaces between attribute names and values.",init:function(e,t,a){var n=this,r=Array.isArray(a)?a:[];e.addListener("tagstart",(function(e){for(var a=e.attrs,i=e.col+e.tagName.length+1,s=0;s<a.length;s++)if(-1===r.indexOf(a[s].name)){var o=/(\s*)=(\s*)/.exec(a[s].raw.trim());!o||0===o[1].length&&0===o[2].length||t.error("The attribute '"+a[s].name+"' must not have spaces between the name and value.",e.line,i+a[s].index,n,a[s].raw)}}))}}}));t(R);var D=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"altRequire",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"attrLowercase",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"attrSort",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"attrNoDuplication",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"attrUnsafeChars",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"attrValueDoubleQuotes",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"attrValueNotEmpty",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"attrValueSingleQuotes",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"attrWhitespace",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"doctypeFirst",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(t,"doctypeHTML5",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"headScriptDisabled",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(t,"hrefAbsOrRel",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(t,"idClsasAdDisabled",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(t,"idClassValue",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"idUnique",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(t,"inlineScriptDisabled",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(t,"inlineStyleDisabled",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(t,"inputRequiresLabel",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(t,"scriptDisabled",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(t,"spaceTabMixedDisabled",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(t,"specCharEscape",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(t,"srcNotEmpty",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(t,"styleDisabled",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(t,"tagPair",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(t,"tagSelfClose",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(t,"tagnameLowercase",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(t,"tagnameSpecialChars",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(t,"titleRequire",{enumerable:!0,get:function(){return q.default}}),Object.defineProperty(t,"tagsCheck",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(t,"attrNoUnnecessaryWhitespace",{enumerable:!0,get:function(){return R.default}})}));t(D);D.altRequire,D.attrLowercase,D.attrSort,D.attrNoDuplication,D.attrUnsafeChars,D.attrValueDoubleQuotes,D.attrValueNotEmpty,D.attrValueSingleQuotes,D.attrWhitespace,D.doctypeFirst,D.doctypeHTML5,D.headScriptDisabled,D.hrefAbsOrRel,D.idClsasAdDisabled,D.idClassValue,D.idUnique,D.inlineScriptDisabled,D.inlineStyleDisabled,D.inputRequiresLabel,D.scriptDisabled,D.spaceTabMixedDisabled,D.specCharEscape,D.srcNotEmpty,D.styleDisabled,D.tagPair,D.tagSelfClose,D.tagnameLowercase,D.tagnameSpecialChars,D.titleRequire,D.tagsCheck,D.attrNoUnnecessaryWhitespace;var H=a((function(e,t){function a(e,t){return new Array(e+1).join(t||" ")}Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLHint=t.HTMLParser=t.Reporter=t.HTMLRules=void 0,t.HTMLParser=n.default,t.Reporter=r.default,t.HTMLRules=D;var i=new(function(){function e(){this.rules={},this.defaultRuleset={"tagname-lowercase":!0,"attr-lowercase":!0,"attr-value-double-quotes":!0,"doctype-first":!0,"tag-pair":!0,"spec-char-escape":!0,"id-unique":!0,"src-not-empty":!0,"attr-no-duplication":!0,"title-require":!0}}return e.prototype.addRule=function(e){this.rules[e.id]=e},e.prototype.verify=function(e,t){void 0!==t&&0!==Object.keys(t).length||(t=this.defaultRuleset),e=e.replace(/^\s*<!--\s*htmlhint\s+([^\r\n]+?)\s*-->/i,(function(e,a){return void 0===t&&(t={}),a.replace(/(?:^|,)\s*([^:,]+)\s*(?:\:\s*([^,\s]+))?/g,(function(e,a,n){"false"===n?n=!1:"true"===n&&(n=!0),t[a]=void 0===n||n})),""}));var a,i=new n.default,s=new r.default(e,t),o=this.rules;for(var l in t)void 0!==(a=o[l])&&!1!==t[l]&&a.init(i,s,t[l]);return i.parse(e),s.messages},e.prototype.format=function(e,t){void 0===t&&(t={});var n=[],r={white:"",grey:"",red:"",reset:""};t.colors&&(r.white="[37m",r.grey="[90m",r.red="[31m",r.reset="[39m");var i=t.indent||0;return e.forEach((function(e){var t=e.evidence,s=e.line,o=e.col,l=t.length,u=o>41?o-40:1,d=t.length>o+60?o+60:l;o<41&&(d+=40-o+1),t=t.replace(/\t/g," ").substring(u-1,d),u>1&&(t="..."+t,u-=3),d<l&&(t+="..."),n.push(r.white+a(i)+"L"+s+" |"+r.grey+t+r.reset);var c=o-u,f=t.substring(0,c).match(/[^\u0000-\u00ff]/g);null!==f&&(c+=f.length),n.push(r.white+a(i)+a(String(s).length+3+c)+"^ "+r.red+e.message+" ("+e.rule.id+")"+r.reset)})),n},e}());t.HTMLHint=i,Object.keys(D).forEach((function(e){i.addRule(D[e])}))})),S=t(H),I=H.HTMLHint,$=H.HTMLParser,z=H.Reporter,V=H.HTMLRules;e.HTMLHint=I,e.HTMLParser=$,e.HTMLRules=V,e.Reporter=z,e.default=S,Object.defineProperty(e,"__esModule",{value:!0})})); |
{ | ||
"name": "htmlhint", | ||
"version": "0.13.0", | ||
"version": "0.13.1-beta.1", | ||
"description": "The Static Code Analysis Tool for your HTML", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/htmlhint/HTMLHint" | ||
"url": "git+https://github.com/htmlhint/HTMLHint.git" | ||
}, | ||
@@ -29,7 +29,8 @@ "bugs": { | ||
"test": "mocha --recursive \"./test/**/*.spec.js\"", | ||
"build": "npm run build:min && npm run build:unmin", | ||
"build": "node build.js", | ||
"build:rollup": "npm run build:min && npm run build:unmin", | ||
"build:min": "rollup -c --environment NODE_ENV:production --file dist/htmlhint.min.js", | ||
"build:unmin": "rollup -c", | ||
"lint:fix": "eslint src/ test/ bin/ --ext .js --max-warnings 0", | ||
"lint": "eslint --fix src/ test/ bin/ --ext .js --max-warnings 0" | ||
"lint": "eslint . --ext .js,.ts --max-warnings 0", | ||
"lint:fix": "eslint --fix . --ext .js,.ts --max-warnings 0" | ||
}, | ||
@@ -79,5 +80,12 @@ "husky": { | ||
"@semantic-release/git": "9.0.0", | ||
"@semantic-release/github": "7.0.5", | ||
"@semantic-release/github": "7.0.6", | ||
"@semantic-release/npm": "7.0.5", | ||
"@semantic-release/release-notes-generator": "9.0.1", | ||
"@types/async": "3.2.3", | ||
"@types/glob": "7.1.1", | ||
"@types/parse-glob": "3.0.29", | ||
"@types/request": "2.48.5", | ||
"@types/xml": "1.0.5", | ||
"@typescript-eslint/eslint-plugin": "3.0.0", | ||
"@typescript-eslint/parser": "3.0.0", | ||
"commitizen": "4.1.2", | ||
@@ -95,6 +103,7 @@ "commitlint": "8.3.5", | ||
"pretty-quick": "2.0.1", | ||
"rollup": "2.10.0", | ||
"rollup": "2.10.3", | ||
"rollup-plugin-babel": "4.4.0", | ||
"rollup-plugin-terser": "5.3.0", | ||
"semantic-release": "17.0.7" | ||
"semantic-release": "17.0.7", | ||
"typescript": "3.9.3" | ||
}, | ||
@@ -101,0 +110,0 @@ "release": { |
@@ -31,3 +31,3 @@ <h1 align="center"> | ||
<p align="center"> | ||
<a href="#installation-and-usage">How To Use</a> • <a href="#contributing">Contributing</a> • <a href="http://roadmap.htmlhint.io/">Roadmap</a> • <a href="https://htmlhint.com">Website</a> | ||
<a href="#installation-and-usage">How To Use</a> • <a href="#contributing">Contributing</a> • <a href="https://htmlhint.com">Website</a> | ||
</p> | ||
@@ -120,5 +120,5 @@ | ||
1. [How to use](https://github.com/htmlhint/HTMLHint/wiki/Usage) | ||
2. [All Rules](https://github.com/htmlhint/HTMLHint/wiki/Rules) | ||
3. [How to Develop](https://github.com/htmlhint/HTMLHint/wiki/Developer-guide) | ||
1. [How to use](https://htmlhint.com/docs/user-guide/usage/cli) | ||
2. [All Rules](https://htmlhint.com/docs/user-guide/list-rules) | ||
3. [How to Develop](CONTRIBUTING.md) | ||
@@ -125,0 +125,0 @@ ## © License |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
159693
44.95%0
-100%34
30.77%1935
-11.4%