Comparing version 1.0.0-beta.1 to 1.0.0
@@ -1,7 +0,8 @@ | ||
# [1.0.0-beta.1](https://github.com/htmlhint/HTMLHint/compare/v0.15.0-beta.1...v1.0.0-beta.1) (2020-06-25) | ||
# [1.0.0](https://github.com/htmlhint/HTMLHint/compare/v0.16.3...v1.0.0) (2021-11-26) | ||
### Continuous Integration | ||
### Features | ||
* trigger major bump ([63f0a7a](https://github.com/htmlhint/HTMLHint/commit/63f0a7adb12401c6b64eb32f7dfaf9ed35aa8250)) | ||
* set minimum support to es6 ([ed5f895](https://github.com/htmlhint/HTMLHint/commit/ed5f89546340df17890e88a9a1df78edb4568cb1)) | ||
* upgrade to Typescript 4 ([472722b](https://github.com/htmlhint/HTMLHint/commit/472722b2c8d61d46576741d388a222c55fe92ea6)) | ||
@@ -11,16 +12,71 @@ | ||
* Rules have a new structure | ||
* IE11 and older browsers will no longer be supported | ||
# [0.15.0-beta.1](https://github.com/htmlhint/HTMLHint/compare/v0.14.0...v0.15.0-beta.1) (2020-06-25) | ||
## [0.16.3](https://github.com/htmlhint/HTMLHint/compare/v0.16.2...v0.16.3) (2021-11-24) | ||
### Reverts | ||
* Revert "chore(deps-dev): upgrade strip-json-comments (#763)" (#767) ([6c2f0cc](https://github.com/htmlhint/HTMLHint/commit/6c2f0cc088e6b154d85e3fbe7046fbcb65d89a96)), closes [#763](https://github.com/htmlhint/HTMLHint/issues/763) [#767](https://github.com/htmlhint/HTMLHint/issues/767) | ||
## [0.16.2](https://github.com/htmlhint/HTMLHint/compare/v0.16.1...v0.16.2) (2021-11-23) | ||
### Bug Fixes | ||
* clenaup non-functional typos ([#727](https://github.com/htmlhint/HTMLHint/issues/727)) ([98e45b9](https://github.com/htmlhint/HTMLHint/commit/98e45b9b2e1d7a4b0576d1944b1769c21b52b11e)) | ||
## [0.16.2](https://github.com/htmlhint/HTMLHint/compare/v0.16.1...v0.16.2) (2021-11-23) | ||
### Bug Fixes | ||
* clenaup non-functional typos ([#727](https://github.com/htmlhint/HTMLHint/issues/727)) ([98e45b9](https://github.com/htmlhint/HTMLHint/commit/98e45b9b2e1d7a4b0576d1944b1769c21b52b11e)) | ||
## [0.16.1](https://github.com/htmlhint/HTMLHint/compare/v0.16.0...v0.16.1) (2021-11-12) | ||
### Bug Fixes | ||
* tagname-specialchars description ([#714](https://github.com/htmlhint/HTMLHint/issues/714)) ([4d702d8](https://github.com/htmlhint/HTMLHint/commit/4d702d8dfac3431fb71516b1ea3eb97950b63835)) | ||
## [0.16.0](https://github.com/htmlhint/HTMLHint/compare/v0.15.2...v0.16.0) (2021-10-29) | ||
### Features | ||
* new configuration structure ([#445](https://github.com/htmlhint/HTMLHint/issues/445)) ([0c55a30](https://github.com/htmlhint/HTMLHint/commit/0c55a301c8aa22481cf2ef5245bb0d3184b338ab)) | ||
* **rules:** add empty-tag-not-self-closed rule ([#696](https://github.com/htmlhint/HTMLHint/issues/696)) ([ec171ac](https://github.com/htmlhint/HTMLHint/commit/ec171ac847b98f495006845836d17f1d19d79b06)), closes [#311](https://github.com/htmlhint/HTMLHint/issues/311) | ||
# [0.14.0](https://github.com/htmlhint/HTMLHint/compare/v0.13.1...v0.14.0) (2020-05-31) | ||
## [0.15.2](https://github.com/htmlhint/HTMLHint/compare/v0.15.1...v0.15.2) (2021-09-16) | ||
### Bug Fixes | ||
* **htmlhint.ts:** replace deprecated request module with what-wg fetch ([#670](https://github.com/htmlhint/HTMLHint/issues/670)) ([250169d](https://github.com/htmlhint/HTMLHint/commit/250169d9e9ab347e512739d113db2b2da703876c)) | ||
## [0.15.1](https://github.com/htmlhint/HTMLHint/compare/v0.15.0...v0.15.1) (2021-06-11) | ||
### Bug Fixes | ||
* Unexpected behavior of the html lang require rule ([#655](https://github.com/htmlhint/HTMLHint/issues/655)) ([068645e](https://github.com/htmlhint/HTMLHint/commit/068645e9111f42adfa0fae0e32e236d88052541c)) | ||
## [0.15.0](https://github.com/htmlhint/HTMLHint/compare/v0.14.2...v0.15.0) (2021-06-10) | ||
### Features | ||
* **rules:** add html-lang-require rule ([#632](https://github.com/htmlhint/HTMLHint/issues/632)) ([51471a9](https://github.com/htmlhint/HTMLHint/commit/51471a99d2e946c124222f6a74fa3fbd1876ac69)) | ||
## [0.14.2](https://github.com/htmlhint/HTMLHint/compare/v0.14.1...v0.14.2) (2020-11-11) | ||
### Bug Fixes | ||
* Link to configuration.md from options page ([#563](https://github.com/htmlhint/HTMLHint/issues/563)) ([9cb0a9c](https://github.com/htmlhint/HTMLHint/commit/9cb0a9c9fcafea4a8c4cd704c66e1faff92ecd7a)) | ||
## [0.14.1](https://github.com/htmlhint/HTMLHint/compare/v0.14.0...v0.14.1) (2020-06-25) | ||
### Bug Fixes | ||
* windows path separator ([#443](https://github.com/htmlhint/HTMLHint/issues/443)) ([8048600](https://github.com/htmlhint/HTMLHint/commit/8048600e5b1568d4a4b469e822bd72a94502b242)) | ||
## [0.14.0](https://github.com/htmlhint/HTMLHint/compare/v0.13.1...v0.14.0) (2020-05-31) | ||
### Features | ||
* use chalk instead of colors ([#433](https://github.com/htmlhint/HTMLHint/issues/433)) ([372dd60](https://github.com/htmlhint/HTMLHint/commit/372dd605e1e4655a5ff4821fcfad9fef9edfb523)) | ||
@@ -30,3 +86,2 @@ | ||
### Bug Fixes | ||
@@ -65,5 +120,4 @@ | ||
# [0.13.0](https://github.com/htmlhint/HTMLHint/compare/v0.12.2...v0.13.0) (2020-05-18) | ||
## [0.13.0](https://github.com/htmlhint/HTMLHint/compare/v0.12.2...v0.13.0) (2020-05-18) | ||
### Bug Fixes | ||
@@ -76,3 +130,2 @@ | ||
### Features | ||
@@ -85,6 +138,4 @@ | ||
# HTMLHint change log | ||
## 0.9.14 (2016-5-2) | ||
## ver 0.9.14 (2016-5-2) | ||
add: | ||
@@ -95,3 +146,3 @@ | ||
## ver 0.9.13 (2016-5-1) | ||
## 0.9.13 (2016-5-1) | ||
@@ -166,3 +217,3 @@ add: | ||
## ver 0.9.7 (2015-3-8) | ||
## 0.9.7 (2015-3-8) | ||
@@ -188,3 +239,3 @@ fix: | ||
## ver 0.9.4 (2013-9-27) | ||
## 0.9.4 (2013-9-27) | ||
@@ -226,3 +277,3 @@ 1. add rule: src-not-empty | ||
## ver 0.9.1 (2013-3-23) | ||
## 0.9.1 (2013-3-23) | ||
@@ -229,0 +280,0 @@ add: |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var chalk = require("chalk"); | ||
var events_1 = require("events"); | ||
var glob_1 = require("glob"); | ||
var path_1 = require("path"); | ||
var HTMLHint; | ||
var options; | ||
var mapFormatters = loadFormatters(); | ||
var arrSupportedFormatters = []; | ||
for (var formatterName in mapFormatters) { | ||
const chalk = require("chalk"); | ||
const events_1 = require("events"); | ||
const glob_1 = require("glob"); | ||
const path_1 = require("path"); | ||
let HTMLHint; | ||
let options; | ||
const mapFormatters = loadFormatters(); | ||
const arrSupportedFormatters = []; | ||
for (const formatterName in mapFormatters) { | ||
if (formatterName !== 'default') { | ||
@@ -17,3 +17,3 @@ arrSupportedFormatters.push(formatterName); | ||
function loadFormatters() { | ||
var arrFiles = glob_1.sync('./formatters/*.js', { | ||
const arrFiles = (0, glob_1.sync)('./formatters/*.js', { | ||
cwd: __dirname, | ||
@@ -25,6 +25,6 @@ dot: false, | ||
}); | ||
var mapFormatters = {}; | ||
arrFiles.forEach(function (file) { | ||
var fileInfo = path_1.parse(file); | ||
var formatterPath = path_1.resolve(__dirname, file); | ||
const mapFormatters = {}; | ||
arrFiles.forEach((file) => { | ||
const fileInfo = (0, path_1.parse)(file); | ||
const formatterPath = (0, path_1.resolve)(__dirname, file); | ||
mapFormatters[fileInfo.name] = require(formatterPath); | ||
@@ -34,3 +34,3 @@ }); | ||
} | ||
var formatter = new events_1.EventEmitter(); | ||
const formatter = new events_1.EventEmitter(); | ||
formatter.getSupported = function () { | ||
@@ -44,3 +44,3 @@ return arrSupportedFormatters; | ||
formatter.setFormat = function (format) { | ||
var formatHandel = mapFormatters[format]; | ||
const formatHandel = mapFormatters[format]; | ||
if (formatHandel === undefined) { | ||
@@ -55,2 +55,2 @@ console.log(chalk.red('No supported formatter, supported formatters: %s'), arrSupportedFormatters.join(', ')); | ||
module.exports = formatter; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybWF0dGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NsaS9mb3JtYXR0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSw2QkFBOEI7QUFDOUIsaUNBQXFDO0FBQ3JDLDZCQUF1QztBQUN2Qyw2QkFBcUM7QUFJckMsSUFBSSxRQUEwQixDQUFBO0FBQzlCLElBQUksT0FBOEIsQ0FBQTtBQUdsQyxJQUFNLGFBQWEsR0FBRyxjQUFjLEVBQUUsQ0FBQTtBQUN0QyxJQUFNLHNCQUFzQixHQUFhLEVBQUUsQ0FBQTtBQUUzQyxLQUFLLElBQU0sYUFBYSxJQUFJLGFBQWEsRUFBRTtJQUN6QyxJQUFJLGFBQWEsS0FBSyxTQUFTLEVBQUU7UUFDL0Isc0JBQXNCLENBQUMsSUFBSSxDQUFDLGFBQWEsQ0FBQyxDQUFBO0tBQzNDO0NBQ0Y7QUFHRCxTQUFTLGNBQWM7SUFDckIsSUFBTSxRQUFRLEdBQUcsV0FBUSxDQUFDLG1CQUFtQixFQUFFO1FBQzdDLEdBQUcsRUFBRSxTQUFTO1FBQ2QsR0FBRyxFQUFFLEtBQUs7UUFDVixLQUFLLEVBQUUsSUFBSTtRQUNYLE1BQU0sRUFBRSxLQUFLO1FBQ2IsTUFBTSxFQUFFLElBQUk7S0FDYixDQUFDLENBQUE7SUFFRixJQUFNLGFBQWEsR0FBMEMsRUFBRSxDQUFBO0lBQy9ELFFBQVEsQ0FBQyxPQUFPLENBQUMsVUFBQyxJQUFJO1FBQ3BCLElBQU0sUUFBUSxHQUFHLFlBQUssQ0FBQyxJQUFJLENBQUMsQ0FBQTt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Q0FBQTtRQUM5QyxhQUFhLENBQUMsUUFBUSxDQUFDLElBQUksQ0FBQyxHQUFHLE9BQU8sQ0FBQyxhQUFhLENBQUMsQ0FBQTtJQUN2RCxDQUFDLENBQUMsQ0FBQTtJQUVGLE9BQU8sYUFBYSxDQUFBO0FBQ3RCLENBQUM7QUF5Q0QsTUFBTSxTQUFTLEdBQWMsSUFBSSxxQkFBWSxFQUFlLENBQUE7QUFFNUQsU0FBUyxDQUFDLFlBQVksR0FBRztJQUN2QixPQUFPLHNCQUFzQixDQUFBO0FBQy9CLENBQUMsQ0FBQTtBQUVELFNBQVMsQ0FBQyxJQUFJLEdBQUcsVUFBVSxXQUFXLEVBQUUsVUFBVTtJQUNoRCxRQUFRLEdBQUcsV0FBVyxDQUFBO0lBQ3RCLE9BQU8sR0FBRyxVQUFVLENBQUE7QUFDdEIsQ0FBQyxDQUFBO0FBRUQsU0FBUyxDQUFDLFNBQVMsR0FBRyxVQUFVLE1BQU07SUFDcEMsTUFBTSxZQUFZLEdBQUcsYUFBYSxDQUFDLE1BQU0sQ0FBQyxDQUFBO0lBRTFDLElBQUksWUFBWSxLQUFLLFNBQVMsRUFBRTtRQUM5QixPQUFPLENBQUMsR0FBRyxDQUNULEtBQUssQ0FBQyxHQUFHLENBQUMsa0RBQWtELENBQUMsRUFDN0Qsc0JBQXNCLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUNsQyxDQUFBO1FBQ0QsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQTtLQUNoQjtTQUFNO1FBQ0wsWUFBWSxDQUFDLFNBQVMsRUFBRSxRQUFRLEVBQUUsT0FBTyxDQUFDLENBQUE7S0FDM0M7QUFDSCxDQUFDLENBQUE7QUFRRCxNQUFNLENBQUMsT0FBTyxHQUFHLFNBQVMsQ0FBQSJ9 |
"use strict"; | ||
var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
r[k] = a[j]; | ||
return r; | ||
}; | ||
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) { | ||
const xml = require("xml"); | ||
const checkstyleFormatter = function (formatter) { | ||
formatter.on('end', (event) => { | ||
const arrFiles = []; | ||
const arrAllMessages = event.arrAllMessages; | ||
arrAllMessages.forEach((fileInfo) => { | ||
const arrMessages = fileInfo.messages; | ||
const arrErrors = []; | ||
arrMessages.forEach((message) => { | ||
arrErrors.push({ | ||
@@ -26,3 +19,3 @@ error: { | ||
message: message.message, | ||
source: "htmlhint." + message.rule.id, | ||
source: `htmlhint.${message.rule.id}`, | ||
}, | ||
@@ -33,3 +26,3 @@ }, | ||
arrFiles.push({ | ||
file: __spreadArrays([ | ||
file: [ | ||
{ | ||
@@ -39,8 +32,9 @@ _attr: { | ||
}, | ||
} | ||
], arrErrors), | ||
}, | ||
...arrErrors, | ||
], | ||
}); | ||
}); | ||
var objXml = { | ||
checkstyle: __spreadArrays([ | ||
const objXml = { | ||
checkstyle: [ | ||
{ | ||
@@ -50,4 +44,5 @@ _attr: { | ||
}, | ||
} | ||
], arrFiles), | ||
}, | ||
...arrFiles, | ||
], | ||
}; | ||
@@ -61,2 +56,2 @@ console.log(xml(objXml, { | ||
module.exports = checkstyleFormatter; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hlY2tzdHlsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbGkvZm9ybWF0d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ENBQUEifQ== |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var chalk = require("chalk"); | ||
var compactFormatter = function (formatter, HTMLHint, options) { | ||
var nocolor = options.nocolor; | ||
var chalkInstance = nocolor !== false ? new chalk.Instance({ level: 1 }) : chalk; | ||
formatter.on('file', function (event) { | ||
event.messages.forEach(function (message) { | ||
const chalk = require("chalk"); | ||
const compactFormatter = function (formatter, HTMLHint, options) { | ||
const nocolor = options.nocolor; | ||
const chalkInstance = nocolor !== false ? new chalk.Instance({ level: 1 }) : chalk; | ||
formatter.on('file', (event) => { | ||
event.messages.forEach((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; | ||
formatter.on('end', (event) => { | ||
const allHintCount = event.allHintCount; | ||
if (allHintCount > 0) { | ||
console.log(''); | ||
var message = '%d problems'; | ||
const message = '%d problems'; | ||
console.log(nocolor ? message : chalkInstance.red(message), event.allHintCount); | ||
@@ -22,2 +22,2 @@ } | ||
module.exports = compactFormatter; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcGFjdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbGkvZm9ybWF0dGVycy9jb21wYWN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsNkJBQThCO0FBRzlCLElBQU0sZ0JBQWdCLEdBQXNCLFVBQzFDLFNBQVMsRUFDVCxRQUFRLEVBQ1IsT0FBTztJQUVQLElBQU0sT0FBTyxHQUFHLE9BQU8sQ0FBQyxPQUFPLENBQUE7SUFFL0IsSUFBTSxhQUFhLEdBQ2pCLE9BQU8sS0FBSyxLQUFLLENBQUMsQ0FBQyxDQUFDLElBQUksS0FBSyxDQUFDLFFBQVEsQ0FBQyxFQU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FBQyxZQUFZLENBQUE7UUFDdkMsSUFBSSxZQUFZLEdBQUcsQ0FBQyxFQUFFO1lBQ3BCLE9BQU8sQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLENBQUE7WUFDZixNQUFNLE9BQU8sR0FBRyxhQUFhLENBQUE7WUFDN0IsT0FBTyxDQUFDLEdBQUcsQ0FDVCxPQUFPLENBQUMsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUMsYUFBYSxDQUFDLEdBQUcsQ0FBQyxPQUFPLENBQUMsRUFDOUMsS0FBSyxDQUFDLFlBQVksQ0FDbkIsQ0FBQTtTQUNGO0lBQ0gsQ0FBQyxDQUFDLENBQUE7QUFDSixDQUFDLENBQUE7QUFFRCxNQUFNLENBQUMsT0FBTyxHQUFHLGdCQUFnQixDQUFBIn0= |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var chalk = require("chalk"); | ||
var defaultFormatter = function (formatter, HTMLHint, options) { | ||
var nocolor = !!options.nocolor; | ||
formatter.on('start', function () { | ||
const chalk = require("chalk"); | ||
const defaultFormatter = function (formatter, HTMLHint, options) { | ||
const nocolor = !!options.nocolor; | ||
formatter.on('start', () => { | ||
console.log(''); | ||
}); | ||
formatter.on('config', function (event) { | ||
var configPath = event.configPath; | ||
formatter.on('config', (event) => { | ||
const configPath = event.configPath; | ||
console.log(' Config loaded: %s', nocolor ? configPath : chalk.cyan(configPath)); | ||
console.log(''); | ||
}); | ||
formatter.on('file', function (event) { | ||
console.log(" " + chalk.white(event.file)); | ||
var arrLogs = HTMLHint.format(event.messages, { | ||
formatter.on('file', (event) => { | ||
console.log(` ${chalk.white(event.file)}`); | ||
const arrLogs = HTMLHint.format(event.messages, { | ||
colors: !nocolor, | ||
indent: 6, | ||
}); | ||
arrLogs.forEach(function (str) { | ||
arrLogs.forEach((str) => { | ||
console.log(str); | ||
@@ -25,8 +25,8 @@ }); | ||
}); | ||
formatter.on('end', function (event) { | ||
var allFileCount = event.allFileCount; | ||
var allHintCount = event.allHintCount; | ||
var allHintFileCount = event.allHintFileCount; | ||
var time = event.time; | ||
var message; | ||
formatter.on('end', (event) => { | ||
const allFileCount = event.allFileCount; | ||
const allHintCount = event.allHintCount; | ||
const allHintFileCount = event.allHintFileCount; | ||
const time = event.time; | ||
let message; | ||
if (allHintCount > 0) { | ||
@@ -43,2 +43,2 @@ message = 'Scanned %d files, found %d errors in %d files (%d ms)'; | ||
module.exports = defaultFormatter; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVmYXVsdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbGkvZm9ybWF0dGVycy9kZWZhdWx0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsNkJBQThCO0FBRzlCLElBQU0sZ0JBQWdCLEdBQXNCLFVBQzFDLFNBQVMsRUFDVCxRQUFRLEVBQ1IsT0FBTztJQUVQLElBQU0sT0FBTyxHQUFHLENBQUMsQ0FBQyxPQUFPLENBQUMsT0FBTyxDQUFBO0lBRWpDLFNBQVMsQ0FBQyxFQUFFLENBQUMsT0FBTyxFQUFFO1FBQ3BCLE9BQU8sQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLENBQUE7SUFDakIsQ0FBQyxDQUFDLENBQUE7SUFFRixTQUFTLENBQUMsRUFBRSxDQUFDLFFBQVEsRUFBRSxVQUFDLEtBQUs7UUFFM0IsSUFBTSxVQUFVLEdBQUcsS0FBSyxDQUFDLFVBQVcsQ0FBQTtRQUNwQyxPQUFPLENBQUMsR0FBRyxDQUNULHNCQUFzQixFQUN0QixPQUFPLENBQUMsQ0FBQyxDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxVQUFVLENBQUMsQ0FDOUMsQ0FBQTtRQUNELE9BQU8sQ0FBQyxHQUFHLENBQUMsRUFB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BWSxDQUFBO1FBQ3ZDLE1BQU0sZ0JBQWdCLEdBQUcsS0FBSyxDQUFDLGdCQUFnQixDQUFBO1FBQy9DLE1BQU0sSUFBSSxHQUFHLEtBQUssQ0FBQyxJQUFJLENBQUE7UUFDdkIsSUFBSSxPQUFPLENBQUE7UUFFWCxJQUFJLFlBQVksR0FBRyxDQUFDLEVBQUU7WUFDcEIsT0FBTyxHQUFHLHVEQUF1RCxDQUFBO1lBQ2pFLE9BQU8sQ0FBQyxHQUFHLENBQ1QsT0FBTyxDQUFDLENBQUMsQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsT0FBTyxDQUFDLEVBQ3RDLFlBQVksRUFDWixZQUFZLEVBQ1osZ0JBQWdCLEVBQ2hCLElBQUksQ0FDTCxDQUFBO1NBQ0Y7YUFBTTtZQUNMLE9BQU8sR0FBRyw0Q0FBNEMsQ0FBQTtZQUN0RCxPQUFPLENBQUMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUMsS0FBSyxDQUFDLE9BQU8sQ0FBQyxFQUFFLFlBQVksRUFBRSxJQUFJLENBQUMsQ0FBQTtTQUMxRTtJQUNILENBQUMsQ0FBQyxDQUFBO0FBQ0osQ0FBQyxDQUFBO0FBRUQsTUFBTSxDQUFDLE9BQU8sR0FBRyxnQkFBZ0IsQ0FBQSJ9 |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var fs_1 = require("fs"); | ||
var htmlFormatter = function (formatter) { | ||
formatter.on('end', function (event) { | ||
var fileContent = '<html>'; | ||
const fs_1 = require("fs"); | ||
const htmlFormatter = function (formatter) { | ||
formatter.on('end', (event) => { | ||
let fileContent = '<html>'; | ||
fileContent += '<head><title>HTML Hint Violation Report</title></head>'; | ||
@@ -13,20 +13,13 @@ fileContent += '<body>'; | ||
'<tr><th>Number#</th><th>File Name</th><th>Line Number</th><th>Message</th></tr>'; | ||
var _loop_1 = function (file, messages) { | ||
for (const { file, messages } of event.arrAllMessages) { | ||
fileContent += messages | ||
.map(function (_a, i) { | ||
var line = _a.line, message = _a.message; | ||
return "<tr><td>" + (i + 1) + "</td><td>" + file + "</td><td>" + line + "</td><td>" + message + "</td></tr>"; | ||
}) | ||
.map(({ line, message }, i) => `<tr><td>${i + 1}</td><td>${file}</td><td>${line}</td><td>${message}</td></tr>`) | ||
.join(''); | ||
}; | ||
for (var _i = 0, _a = event.arrAllMessages; _i < _a.length; _i++) { | ||
var _b = _a[_i], file = _b.file, messages = _b.messages; | ||
_loop_1(file, messages); | ||
} | ||
fileContent += '</table></body></html>'; | ||
console.log(fileContent); | ||
fs_1.writeFileSync('report.html', fileContent); | ||
(0, fs_1.writeFileSync)('report.html', fileContent); | ||
}); | ||
}; | ||
module.exports = htmlFormatter; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHRtbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbGkvZm9ybWF0dGVycy9odG1sLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEseUJBQWtDO0FBR2xDLElBQU0sYUFBYSxHQUFzQixVQUFVLFNBQVM7SUFDMUQsU0FBUyxDQUFDLEVBQUUsQ0FBQyxLQUFLLEVBQUUsVUFBQyxLQUFLO1FBQ3hCLElBQUksV0FBVyxHQUFHLFFBQVEsQ0FBQTtRQUMxQixXQUFXLElBQUksd0RBQXdELENBQUE7UUFDdkUsV0FBVyxJQUFJLFFBQVEsQ0FBQTtRQUN2QixXQUFXLElBQUksNENBQTRDLENBQUE7UUFFM0QsV0FBVyxJQUFJLG9CQUFvQixDQUFBO1FBQ25DLFdBQVc7WUFDVCxpRkFBaUYsQ0FBQTtnQ0FFdEUsSUFBSSxFQUFFLFFBQVE7WUFDekIsV0FBVyxJQUFJ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QUFRLENBQUE7UUFDMUIsV0FBVyxJQUFJLHdEQUF3RCxDQUFBO1FBQ3ZFLFdBQVcsSUFBSSxRQUFRLENBQUE7UUFDdkIsV0FBVyxJQUFJLDRDQUE0QyxDQUFBO1FBRTNELFdBQVcsSUFBSSxvQkFBb0IsQ0FBQTtRQUNuQyxXQUFXO1lBQ1QsaUZBQWlGLENBQUE7UUFFbkYsS0FBSyxNQUFNLEVBQUUsSUFBSSxFQUFFLFFBQVEsRUFBRSxJQUFJLEtBQUssQ0FBQyxjQUFjLEVBQUU7WUFDckQsV0FBVyxJQUFJLFFBQVE7aUJBQ3BCLEdBQUcsQ0FDRixDQUFDLEVBQUUsSUFBSSxFQUFFLE9BQU8sRUFBRSxFQUFFLENBQUMsRUFBRSxFQUFFLENBQ3ZCLFdBQ0UsQ0FBQyxHQUFHLENBQ04sWUFBWSxJQUFJLFlBQVksSUFBSSxZQUFZLE9BQU8sWUFBWSxDQUNsRTtpQkFDQSxJQUFJLENBQUMsRUFBRSxDQUFDLENBQUE7U0FDWjtRQUVELFdBQVcsSUFBSSx3QkFBd0IsQ0FBQTtRQUN2QyxPQUFPLENBQUMsR0FBRyxDQUFDLFdBQVcsQ0FBQyxDQUFBO1FBQ3hCLElBQUEsa0JBQWEsRUFBQyxhQUFhLEVBQUUsV0FBVyxDQUFDLENBQUE7SUFDM0MsQ0FBQyxDQUFDLENBQUE7QUFDSixDQUFDLENBQUE7QUFFRCxNQUFNLENBQUMsT0FBTyxHQUFHLGFBQWEsQ0FBQSJ9 |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var jsonFormatter = function (formatter) { | ||
formatter.on('end', function (event) { | ||
const jsonFormatter = function (formatter) { | ||
formatter.on('end', (event) => { | ||
console.log(JSON.stringify(event.arrAllMessages)); | ||
@@ -9,2 +9,2 @@ }); | ||
module.exports = jsonFormatter; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoianNvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbGkvZm9ybWF0dGVycy9qc29uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBRUEsSUFBTSxhQUFhLEdBQXNCLFVBQVUsU0FBUztJQUMxRCxTQUFTLENBQUMsRUFBRSxDQUFDLEtBQUssRUFBRSxVQUFDLEtBQUs7UUFDeEIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsU0FBUyxDQUFDLEtBQUssQ0FBQyxjQUFjLENBQUMsQ0FBQyxDQUFBO0lBQ25ELENBQUMsQ0FBQyxDQUFBO0FBQ0osQ0FBQyxDQUFBO0FBRUQsTUFBTSxDQUFDLE9BQU8sR0FBRyxhQUFhLENBQUEifQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoianNvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbGkvZm9ybWF0dGVycy9qc29uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBRUEsTUFBTSxhQUFhLEdBQXNCLFVBQVUsU0FBUztJQUMxRCxTQUFTLENBQUMsRUFBRSxDQUFDLEtBQUssRUFBRSxDQUFDLEtBQUssRUFBRSxFQUFFO1FBQzVCLE9BQU8sQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsY0FBYyxDQUFDLENBQUMsQ0FBQTtJQUNuRCxDQUFDLENBQUMsQ0FBQTtBQUNKLENBQUMsQ0FBQTtBQUVELE1BQU0sQ0FBQyxPQUFPLEdBQUcsYUFBYSxDQUFBIn0= |
"use strict"; | ||
var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
r[k] = a[j]; | ||
return r; | ||
}; | ||
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); | ||
const xml = require("xml"); | ||
const junitFormatter = function (formatter, HTMLHint) { | ||
formatter.on('end', (event) => { | ||
const arrTestcase = []; | ||
const arrAllMessages = event.arrAllMessages; | ||
arrAllMessages.forEach((fileInfo) => { | ||
const arrMessages = fileInfo.messages; | ||
const arrLogs = HTMLHint.format(arrMessages); | ||
arrTestcase.push({ | ||
@@ -29,3 +22,3 @@ testcase: [ | ||
_attr: { | ||
message: "Found " + arrMessages.length + " errors", | ||
message: `Found ${arrMessages.length} errors`, | ||
}, | ||
@@ -38,6 +31,6 @@ _cdata: arrLogs.join('\r\n'), | ||
}); | ||
var objXml = { | ||
const objXml = { | ||
testsuites: [ | ||
{ | ||
testsuite: __spreadArrays([ | ||
testsuite: [ | ||
{ | ||
@@ -50,4 +43,5 @@ _attr: { | ||
}, | ||
} | ||
], arrTestcase), | ||
}, | ||
...arrTestcase, | ||
], | ||
}, | ||
@@ -63,2 +57,2 @@ ], | ||
module.exports = junitFormatter; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoianVuaXQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY2xpL2Zvcm1hdHRlcnMvanVuaXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQUEseUJBQTBCO0FBSTFCLElBQU0sY0FBYyxHQUFzQixVQUFVLFNBQVMsRUFBRSxRQUFRO0lBQ3JFLFNBQVMs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0FDZixDQUFDLENBQ0gsQ0FBQTtJQUNILENBQUMsQ0FBQyxDQUFBO0FBQ0osQ0FBQyxDQUFBO0FBRUQsTUFBTSxDQUFDLE9BQU8sR0FBRyxjQUFjLENBQUEifQ== |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var markdownFormatter = function (formatter, HTMLHint) { | ||
formatter.on('end', function (event) { | ||
const markdownFormatter = function (formatter, HTMLHint) { | ||
formatter.on('end', (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) { | ||
const arrToc = []; | ||
const arrContents = []; | ||
const arrAllMessages = event.arrAllMessages; | ||
arrAllMessages.forEach((fileInfo) => { | ||
const filePath = fileInfo.file; | ||
const arrMessages = fileInfo.messages; | ||
let errorCount = 0; | ||
let warningCount = 0; | ||
arrMessages.forEach((message) => { | ||
if (message.type === 'error') { | ||
@@ -22,15 +22,15 @@ errorCount++; | ||
}); | ||
arrToc.push(" - [" + filePath + "](#" + filePath + ")"); | ||
arrContents.push("<a name=\"" + filePath + "\" />"); | ||
arrContents.push("# " + filePath); | ||
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(`Found ${errorCount} errors, ${warningCount} warnings`); | ||
const arrLogs = HTMLHint.format(arrMessages); | ||
arrContents.push(''); | ||
arrLogs.forEach(function (log) { | ||
arrContents.push(" " + log); | ||
arrLogs.forEach((log) => { | ||
arrContents.push(` ${log}`); | ||
}); | ||
arrContents.push(''); | ||
}); | ||
console.log(arrToc.join('\r\n') + "\r\n"); | ||
console.log(`${arrToc.join('\r\n')}\r\n`); | ||
console.log(arrContents.join('\r\n')); | ||
@@ -40,2 +40,2 @@ }); | ||
module.exports = markdownFormatter; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFya2Rvd24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY2xpL2Zvcm1hdHRlcnMvbWFya2Rvd24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFFQSxJQUFNLGlCQUFpQixHQUFzQixVQUFVLFNBQVMsRUFBRSxRQUFRO0lBQ3hFLFNBQVMsQ0FBQyxFQUFFLENBQUMsS0FBSyxFQUFFLFVBQUMsS0FBSztRQUN4QixPQUFPLENBQUMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFBO1FBRXBCLElBQU0sTUFBTSxHQUFhLEVBQUUsQ0FBQTtRQUMzQixJQUFNLFdBQVcsR0FBYSxFQUFFLENBQUE7UUFDaEMsSUFBTSxjQUFjLEdBQUcsS0FBSyxDQUFDLGNBQWMsQ0FBQTtRQUUzQyxjQUFjLENBQUMsT0FBTyxDQUFDLFVBQUMsUUFBUTtZQUM5QixJQUFNLFFBQVEsR0FBRyxRQUFRLENBQUMsSUFBSSxDQUFBO1lBQzlCLElBQU0sV0FBVyxHQUFHLFFBQVEsQ0FBQyxRQUFRLENBQUE7WUFDckMsSUFBSSxVQUFVLEdBQUcsQ0FBQyxDQUFBO1lBQ2xCLElBQUksWUFBWSxHQUFHLENBQUMsQ0FBQTtZQUVwQixXQUFXLENBQUMsT0FBTyxDQUFDLFVBQUMsT0FBTztnQkFDMUIsSUFBSSxPQUFPLENBQUMsSUFBSSxLQUFLLE9BQU8sRUFBRTtvQkFDNUIsVUFBVSxFQUFFLENBQUE7aUJBQ2I7cUJBQU07b0JBQ0wsWUFBWSxFQUFFLENBQUE7aUJBQ2Y7WUFDSCx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vQyxXQUFXLENBQUMsSUFBSSxDQUFDLFlBQVksUUFBUSxNQUFNLENBQUMsQ0FBQTtZQUM1QyxXQUFXLENBQUMsSUFBSSxDQUFDLEtBQUssUUFBUSxFQUFFLENBQUMsQ0FBQTtZQUNqQyxXQUFXLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxDQUFBO1lBQ3BCLFdBQVcsQ0FBQyxJQUFJLENBQUMsU0FBUyxVQUFVLFlBQVksWUFBWSxXQUFXLENBQUMsQ0FBQTtZQUV4RSxNQUFNLE9BQU8sR0FBRyxRQUFRLENBQUMsTUFBTSxDQUFDLFdBQVcsQ0FBQyxDQUFBO1lBQzVDLFdBQVcsQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLENBQUE7WUFDcEIsT0FBTyxDQUFDLE9BQU8sQ0FBQyxDQUFDLEdBQUcsRUFBRSxFQUFFO2dCQUN0QixXQUFXLENBQUMsSUFBSSxDQUFDLE9BQU8sR0FBRyxFQUFFLENBQUMsQ0FBQTtZQUNoQyxDQUFDLENBQUMsQ0FBQTtZQUNGLFdBQVcsQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLENBQUE7UUFDdEIsQ0FBQyxDQUFDLENBQUE7UUFFRixPQUFPLENBQUMsR0FBRyxDQUFDLEdBQUcsTUFBTSxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUE7UUFDekMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxXQUFXLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUE7SUFDdkMsQ0FBQyxDQUFDLENBQUE7QUFDSixDQUFDLENBQUE7QUFFRCxNQUFNLENBQUMsT0FBTyxHQUFHLGlCQUFpQixDQUFBIn0= |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var chalk = require("chalk"); | ||
var unixFormatter = function (formatter, HTMLHint, options) { | ||
var nocolor = options.nocolor; | ||
var chalkInstance = nocolor !== false ? new chalk.Instance({ level: 1 }) : chalk; | ||
formatter.on('file', function (event) { | ||
event.messages.forEach(function (message) { | ||
const chalk = require("chalk"); | ||
const unixFormatter = function (formatter, HTMLHint, options) { | ||
const nocolor = options.nocolor; | ||
const chalkInstance = nocolor !== false ? new chalk.Instance({ level: 1 }) : chalk; | ||
formatter.on('file', (event) => { | ||
event.messages.forEach((message) => { | ||
console.log([ | ||
@@ -13,11 +13,11 @@ event.file, | ||
message.col, | ||
" " + message.message + " [" + message.type + "/" + message.rule.id + "]", | ||
` ${message.message} [${message.type}/${message.rule.id}]`, | ||
].join(':')); | ||
}); | ||
}); | ||
formatter.on('end', function (event) { | ||
var allHintCount = event.allHintCount; | ||
formatter.on('end', (event) => { | ||
const allHintCount = event.allHintCount; | ||
if (allHintCount > 0) { | ||
console.log(''); | ||
var message = '%d problems'; | ||
const message = '%d problems'; | ||
console.log(nocolor ? message : chalkInstance.red(message), event.allHintCount); | ||
@@ -28,2 +28,2 @@ } | ||
module.exports = unixFormatter; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidW5peC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbGkvZm9ybWF0dGVycy91bml4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsNkJBQThCO0FBRzlCLElBQU0sYUFBYSxHQUFzQixVQUN2QyxTQUFTLEVBQ1QsUUFBUSxFQUNSLE9BQU87SUFFUCxJQUFNLE9BQU8sR0FBRyxPQUFPLENBQUMsT0FBTyxDQUFBO0lBRS9CLElBQU0sYUFBYSxHQUNqQixPQUFPLEtBQUssS0FBSyxDQUFDLENBQUMsQ0FBQyxJQUFJLEtBQUssQ0FBQyxRQUFRLENBQUMsRUFBRSxLQUFLLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFBO0lBRTlELFNBQVMsQ0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ElBQUksWUFBWSxHQUFHLENBQUMsRUFBRTtZQUNwQixPQUFPLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxDQUFBO1lBQ2YsTUFBTSxPQUFPLEdBQUcsYUFBYSxDQUFBO1lBQzdCLE9BQU8sQ0FBQyxHQUFHLENBQ1QsT0FBTyxDQUFDLENBQUMsQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLGFBQWEsQ0FBQyxHQUFHLENBQUMsT0FBTyxDQUFDLEVBQzlDLEtBQUssQ0FBQyxZQUFZLENBQ25CLENBQUE7U0FDRjtJQUNILENBQUMsQ0FBQyxDQUFBO0FBQ0osQ0FBQyxDQUFBO0FBRUQsTUFBTSxDQUFDLE9BQU8sR0FBRyxhQUFhLENBQUEifQ== |
#!/usr/bin/env node | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var async_1 = require("async"); | ||
var chalk = require("chalk"); | ||
var program = require("commander"); | ||
var fs_1 = require("fs"); | ||
var glob = require("glob"); | ||
var parseGlob = require("parse-glob"); | ||
var path_1 = require("path"); | ||
var request = require("request"); | ||
var stripJsonComments = require("strip-json-comments"); | ||
var HTMLHint = require('../htmlhint.js').HTMLHint; | ||
var formatter = require('./formatter'); | ||
var pkg = require('../../package.json'); | ||
const async_1 = require("async"); | ||
const chalk = require("chalk"); | ||
const commander_1 = require("commander"); | ||
const fs_1 = require("fs"); | ||
const glob = require("glob"); | ||
const parseGlob = require("parse-glob"); | ||
const path_1 = require("path"); | ||
const node_fetch_1 = require("node-fetch"); | ||
const stripJsonComments = require("strip-json-comments"); | ||
const HTMLHint = require('../htmlhint.js').HTMLHint; | ||
const formatter = require('./formatter'); | ||
const pkg = require('../../package.json'); | ||
function map(val) { | ||
var objMap = {}; | ||
val.split(',').forEach(function (item) { | ||
var arrItem = item.split(/\s*=\s*/); | ||
const objMap = {}; | ||
val.split(',').forEach((item) => { | ||
const arrItem = item.split(/\s*=\s*/); | ||
objMap[arrItem[0]] = arrItem[1] ? arrItem[1] : true; | ||
@@ -24,3 +24,4 @@ }); | ||
} | ||
program.on('--help', function () { | ||
const program = new commander_1.Command(); | ||
program.on('--help', () => { | ||
console.log(' Examples:'); | ||
@@ -42,3 +43,3 @@ console.log(''); | ||
}); | ||
var arrSupportedFormatters = formatter.getSupported(); | ||
const arrSupportedFormatters = formatter.getSupported(); | ||
program | ||
@@ -51,3 +52,3 @@ .version(pkg.version) | ||
.option('-R, --rulesdir <file|folder>', 'load custom rules from file or folder') | ||
.option("-f, --format <" + arrSupportedFormatters.join('|') + ">", 'output messages as custom format') | ||
.option(`-f, --format <${arrSupportedFormatters.join('|')}>`, 'output messages as custom format') | ||
.option('-i, --ignore <pattern, pattern ...>', 'add pattern to exclude matches') | ||
@@ -57,7 +58,8 @@ .option('--nocolor', 'disable color') | ||
.parse(process.argv); | ||
if (program.list) { | ||
const cliOptions = program.opts(); | ||
if (cliOptions.list) { | ||
listRules(); | ||
process.exit(0); | ||
} | ||
var arrTargets = program.args; | ||
const arrTargets = program.args; | ||
if (arrTargets.length === 0) { | ||
@@ -67,5 +69,5 @@ arrTargets.push('./'); | ||
formatter.init(HTMLHint, { | ||
nocolor: program.nocolor, | ||
nocolor: cliOptions.nocolor, | ||
}); | ||
var format = program.format || 'default'; | ||
const format = cliOptions.format || 'default'; | ||
if (format) { | ||
@@ -75,13 +77,13 @@ formatter.setFormat(format); | ||
hintTargets(arrTargets, { | ||
rulesdir: program.rulesdir, | ||
ruleset: program.rules, | ||
rulesdir: cliOptions.rulesdir, | ||
ruleset: cliOptions.rules, | ||
formatter: formatter, | ||
ignore: program.ignore, | ||
ignore: cliOptions.ignore, | ||
}); | ||
function listRules() { | ||
var rules = HTMLHint.rules; | ||
var rule; | ||
const rules = HTMLHint.rules; | ||
let rule; | ||
console.log(' All rules:'); | ||
console.log(' =================================================='); | ||
for (var id in rules) { | ||
for (const id in rules) { | ||
rule = rules[id]; | ||
@@ -92,9 +94,9 @@ console.log(' %s : %s', chalk.bold(rule.id), rule.description); | ||
function hintTargets(arrTargets, options) { | ||
var arrAllMessages = []; | ||
var allFileCount = 0; | ||
var allHintFileCount = 0; | ||
var allHintCount = 0; | ||
var startTime = new Date().getTime(); | ||
var formatter = options.formatter; | ||
var rulesdir = options.rulesdir; | ||
let arrAllMessages = []; | ||
let allFileCount = 0; | ||
let allHintFileCount = 0; | ||
let allHintCount = 0; | ||
const startTime = new Date().getTime(); | ||
const formatter = options.formatter; | ||
const rulesdir = options.rulesdir; | ||
if (rulesdir) { | ||
@@ -104,6 +106,6 @@ loadCustomRules(rulesdir); | ||
formatter.emit('start'); | ||
var arrTasks = []; | ||
arrTargets.forEach(function (target) { | ||
arrTasks.push(function (next) { | ||
hintAllFiles(target, options, function (result) { | ||
const arrTasks = []; | ||
arrTargets.forEach((target) => { | ||
arrTasks.push((next) => { | ||
hintAllFiles(target, options, (result) => { | ||
allFileCount += result.targetFileCount; | ||
@@ -117,4 +119,4 @@ allHintFileCount += result.targetHintFileCount; | ||
}); | ||
async_1.series(arrTasks, function () { | ||
var spendTime = new Date().getTime() - startTime; | ||
(0, async_1.series)(arrTasks, () => { | ||
const spendTime = new Date().getTime() - startTime; | ||
formatter.emit('end', { | ||
@@ -127,3 +129,3 @@ arrAllMessages: arrAllMessages, | ||
}); | ||
process.exit(!program.warn && allHintCount > 0 ? 1 : 0); | ||
process.exit(!cliOptions.warn && allHintCount > 0 ? 1 : 0); | ||
}); | ||
@@ -133,7 +135,7 @@ } | ||
rulesdir = rulesdir.replace(/\\/g, '/'); | ||
if (fs_1.existsSync(rulesdir)) { | ||
if (fs_1.statSync(rulesdir).isDirectory()) { | ||
if ((0, fs_1.existsSync)(rulesdir)) { | ||
if ((0, fs_1.statSync)(rulesdir).isDirectory()) { | ||
rulesdir += /\/$/.test(rulesdir) ? '' : '/'; | ||
rulesdir += '**/*.js'; | ||
var arrFiles = glob.sync(rulesdir, { | ||
const arrFiles = glob.sync(rulesdir, { | ||
dot: false, | ||
@@ -144,3 +146,3 @@ nodir: true, | ||
}); | ||
arrFiles.forEach(function (file) { | ||
arrFiles.forEach((file) => { | ||
loadRule(file); | ||
@@ -155,6 +157,6 @@ }); | ||
function loadRule(filepath) { | ||
filepath = path_1.resolve(filepath); | ||
filepath = (0, path_1.resolve)(filepath); | ||
try { | ||
var module_1 = require(filepath); | ||
module_1(HTMLHint); | ||
const module = require(filepath); | ||
module(HTMLHint); | ||
} | ||
@@ -164,16 +166,16 @@ catch (e) { | ||
} | ||
function hintAllFiles(target, options, onFinised) { | ||
var globInfo = getGlobInfo(target); | ||
function hintAllFiles(target, options, onFinished) { | ||
const globInfo = getGlobInfo(target); | ||
globInfo.ignore = options.ignore; | ||
var formatter = options.formatter; | ||
var targetFileCount = 0; | ||
var targetHintFileCount = 0; | ||
var targetHintCount = 0; | ||
var arrTargetMessages = []; | ||
var ruleset = options.ruleset; | ||
const formatter = options.formatter; | ||
let targetFileCount = 0; | ||
let targetHintFileCount = 0; | ||
let targetHintCount = 0; | ||
const arrTargetMessages = []; | ||
let ruleset = options.ruleset; | ||
if (ruleset === undefined) { | ||
ruleset = getConfig(program.config, globInfo.base, formatter); | ||
ruleset = getConfig(cliOptions.config, globInfo.base, formatter); | ||
} | ||
var hintQueue = async_1.queue(function (filepath, next) { | ||
var startTime = new Date().getTime(); | ||
const hintQueue = (0, async_1.queue)((filepath, next) => { | ||
const startTime = new Date().getTime(); | ||
if (filepath === 'stdin') { | ||
@@ -186,8 +188,8 @@ hintStdin(ruleset, hintNext); | ||
else { | ||
var messages = hintFile(filepath, ruleset); | ||
const messages = hintFile(filepath, ruleset); | ||
hintNext(messages); | ||
} | ||
function hintNext(messages) { | ||
var spendTime = new Date().getTime() - startTime; | ||
var hintCount = messages.length; | ||
const spendTime = new Date().getTime() - startTime; | ||
const hintCount = messages.length; | ||
if (hintCount > 0) { | ||
@@ -211,5 +213,5 @@ formatter.emit('file', { | ||
}, 10); | ||
var isWalkDone = false; | ||
var isHintDone = true; | ||
hintQueue.drain(function () { | ||
let isWalkDone = false; | ||
let isHintDone = true; | ||
hintQueue.drain(() => { | ||
isHintDone = true; | ||
@@ -220,3 +222,3 @@ checkAllHinted(); | ||
if (isWalkDone && isHintDone) { | ||
onFinised({ | ||
onFinished({ | ||
targetFileCount: targetFileCount, | ||
@@ -231,13 +233,13 @@ targetHintFileCount: targetHintFileCount, | ||
isWalkDone = true; | ||
hintQueue.push(target); | ||
void hintQueue.push(target); | ||
} | ||
else if (/^https?:\/\//.test(target)) { | ||
isWalkDone = true; | ||
hintQueue.push(target); | ||
void hintQueue.push(target); | ||
} | ||
else { | ||
walkPath(globInfo, function (filepath) { | ||
walkPath(globInfo, (filepath) => { | ||
isHintDone = false; | ||
hintQueue.push(filepath); | ||
}, function () { | ||
void hintQueue.push(filepath); | ||
}, () => { | ||
isWalkDone = true; | ||
@@ -250,8 +252,8 @@ checkAllHinted(); | ||
target = target.replace(/\\/g, '/'); | ||
var globInfo = parseGlob(target); | ||
var base = path_1.resolve(globInfo.base); | ||
const globInfo = parseGlob(target); | ||
let base = (0, path_1.resolve)(globInfo.base); | ||
base += /\/$/.test(base) ? '' : '/'; | ||
var pattern = globInfo.glob; | ||
var globPath = globInfo.path; | ||
var defaultGlob = '*.{htm,html}'; | ||
let pattern = globInfo.glob; | ||
const globPath = globInfo.path; | ||
const defaultGlob = '*.{htm,html}'; | ||
if (globInfo.is.glob === true) { | ||
@@ -264,7 +266,7 @@ if (globPath.basename === '') { | ||
if (globPath.basename === '') { | ||
pattern += "**/" + defaultGlob; | ||
pattern += `**/${defaultGlob}`; | ||
} | ||
else if (fs_1.existsSync(target) && fs_1.statSync(target).isDirectory()) { | ||
base += globPath.basename + "/"; | ||
pattern = "**/" + defaultGlob; | ||
else if ((0, fs_1.existsSync)(target) && (0, fs_1.statSync)(target).isDirectory()) { | ||
base += `${globPath.basename}/`; | ||
pattern = `**/${defaultGlob}`; | ||
} | ||
@@ -278,9 +280,9 @@ } | ||
function getConfig(configPath, base, formatter) { | ||
if (configPath === undefined && fs_1.existsSync(base)) { | ||
if (fs_1.statSync(base).isDirectory() === false) { | ||
base = path_1.dirname(base); | ||
if (configPath === undefined && (0, fs_1.existsSync)(base)) { | ||
if ((0, fs_1.statSync)(base).isDirectory() === false) { | ||
base = (0, path_1.dirname)(base); | ||
} | ||
while (base) { | ||
var tmpConfigFile = path_1.resolve(base, '.htmlhintrc'); | ||
if (fs_1.existsSync(tmpConfigFile)) { | ||
const tmpConfigFile = (0, path_1.resolve)(base, '.htmlhintrc'); | ||
if ((0, fs_1.existsSync)(tmpConfigFile)) { | ||
configPath = tmpConfigFile; | ||
@@ -295,5 +297,5 @@ break; | ||
} | ||
if (configPath !== undefined && fs_1.existsSync(configPath)) { | ||
var config = fs_1.readFileSync(configPath, 'utf-8'); | ||
var ruleset = {}; | ||
if (configPath !== undefined && (0, fs_1.existsSync)(configPath)) { | ||
const config = (0, fs_1.readFileSync)(configPath, 'utf-8'); | ||
let ruleset = {}; | ||
try { | ||
@@ -312,12 +314,12 @@ ruleset = JSON.parse(stripJsonComments(config)); | ||
function walkPath(globInfo, callback, onFinish) { | ||
var base = globInfo.base; | ||
var pattern = globInfo.pattern; | ||
var ignore = globInfo.ignore; | ||
var arrIgnores = ['**/node_modules/**']; | ||
let base = globInfo.base; | ||
const pattern = globInfo.pattern; | ||
const ignore = globInfo.ignore; | ||
const arrIgnores = ['**/node_modules/**']; | ||
if (ignore) { | ||
ignore.split(',').forEach(function (pattern) { | ||
ignore.split(',').forEach((pattern) => { | ||
arrIgnores.push(pattern); | ||
}); | ||
} | ||
var walk = glob(pattern, { | ||
const walk = glob(pattern, { | ||
cwd: base, | ||
@@ -329,7 +331,10 @@ dot: false, | ||
silent: true, | ||
}, function () { | ||
}, () => { | ||
onFinish(); | ||
}); | ||
walk.on('match', function (file) { | ||
walk.on('match', (file) => { | ||
base = base.replace(/^.\//, ''); | ||
if (path_1.sep !== '/') { | ||
base = base.replace(/\//g, path_1.sep); | ||
} | ||
callback(base + file); | ||
@@ -339,5 +344,5 @@ }); | ||
function hintFile(filepath, ruleset) { | ||
var content = ''; | ||
let content = ''; | ||
try { | ||
content = fs_1.readFileSync(filepath, 'utf-8'); | ||
content = (0, fs_1.readFileSync)(filepath, 'utf-8'); | ||
} | ||
@@ -350,9 +355,9 @@ catch (e) { | ||
process.stdin.setEncoding('utf8'); | ||
var buffers = []; | ||
process.stdin.on('data', function (text) { | ||
const buffers = []; | ||
process.stdin.on('data', (text) => { | ||
buffers.push(text); | ||
}); | ||
process.stdin.on('end', function () { | ||
var content = buffers.join(''); | ||
var messages = HTMLHint.verify(content, ruleset); | ||
process.stdin.on('end', () => { | ||
const content = buffers.join(''); | ||
const messages = HTMLHint.verify(content, ruleset); | ||
callback(messages); | ||
@@ -362,12 +367,15 @@ }); | ||
function hintUrl(url, ruleset, callback) { | ||
request.get(url, function (error, response, body) { | ||
if (!error && response.statusCode == 200) { | ||
var messages = HTMLHint.verify(body, ruleset); | ||
callback(messages); | ||
const errorFn = () => callback([]); | ||
(0, node_fetch_1.default)(url).then((response) => { | ||
if (response.ok) { | ||
response.text().then((body) => { | ||
const messages = HTMLHint.verify(body, ruleset); | ||
callback(messages); | ||
}, errorFn); | ||
} | ||
else { | ||
callback([]); | ||
errorFn(); | ||
} | ||
}); | ||
}, errorFn); | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHRtbGhpbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY2xpL2h0bWxoaW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBLCtCQUFrRTtBQUNsRSw2QkFBOEI7QUFDOUIsbUNBQW9DO0FBQ3BDLHlCQUF1RDtBQUN2RCwyQkFBNEI7QUFDNUIsc0NBQXVDO0FBQ3ZDLDZCQUE0QztBQUM1QyxpQ0FBa0M7QUFDbEMsdURBQXdEO0FBS3hELElBQU0sUUFBUSxHQUFxQixPQUFPLENBQU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QztBQUdELFNBQVMsT0FBTyxDQUNkLEdBQVcsRUFDWCxPQUE0QixFQUM1QixRQUFvQztJQUVwQyxNQUFNLE9BQU8sR0FBRyxHQUFHLEVBQUUsQ0FBQyxRQUFRLENBQUMsRUFBRSxDQUFDLENBQUE7SUFDbEMsSUFBQSxvQkFBSyxFQUFDLEdBQUcsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLFFBQVEsRUFBRSxFQUFFO1FBQzNCLElBQUksUUFBUSxDQUFDLEVBQUUsRUFBRTtZQUNmLFFBQVEsQ0FBQyxJQUFJLEVBQUUsQ0FBQyxJQUFJLENBQUMsQ0FBQyxJQUFJLEVBQUUsRUFBRTtnQkFDNUIsTUFBTSxRQUFRLEdBQUcsUUFBUSxDQUFDLE1BQU0sQ0FBQyxJQUFJLEVBQUUsT0FBTyxDQUFDLENBQUE7Z0JBQy9DLFFBQVEsQ0FBQyxRQUFRLENBQUMsQ0FBQTtZQUNwQixDQUFDLEVBQUUsT0FBTyxDQUFDLENBQUE7U0FDWjthQUFNO1lBQ0wsT0FBTyxFQUFFLENBQUE7U0FDVjtJQUNILENBQUMsRUFBRSxPQUFPLENBQUMsQ0FBQTtBQUNiLENBQUMifQ== |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.HTMLParser = exports.Reporter = exports.HTMLRules = exports.HTMLHint = void 0; | ||
var htmlparser_1 = require("./htmlparser"); | ||
const htmlparser_1 = require("./htmlparser"); | ||
exports.HTMLParser = htmlparser_1.default; | ||
var reporter_1 = require("./reporter"); | ||
const reporter_1 = require("./reporter"); | ||
exports.Reporter = reporter_1.default; | ||
var HTMLRules = require("./rules"); | ||
const HTMLRules = require("./rules"); | ||
exports.HTMLRules = HTMLRules; | ||
var types_1 = require("./types"); | ||
var HTMLHintCore = (function () { | ||
function HTMLHintCore() { | ||
class HTMLHintCore { | ||
constructor() { | ||
this.rules = {}; | ||
this.defaultRuleset = { | ||
'tagname-lowercase': 'error', | ||
'attr-lowercase': 'error', | ||
'attr-value-double-quotes': 'error', | ||
'doctype-first': 'error', | ||
'tag-pair': 'error', | ||
'spec-char-escape': 'error', | ||
'id-unique': 'error', | ||
'src-not-empty': 'error', | ||
'attr-no-duplication': 'error', | ||
'title-require': 'error', | ||
'tagname-lowercase': true, | ||
'attr-lowercase': true, | ||
'attr-value-double-quotes': true, | ||
'doctype-first': true, | ||
'tag-pair': true, | ||
'spec-char-escape': true, | ||
'id-unique': true, | ||
'src-not-empty': true, | ||
'attr-no-duplication': true, | ||
'title-require': true, | ||
}; | ||
} | ||
HTMLHintCore.prototype.addRule = function (rule) { | ||
addRule(rule) { | ||
this.rules[rule.id] = rule; | ||
}; | ||
HTMLHintCore.prototype.verify = function (html, ruleset) { | ||
if (ruleset === void 0) { ruleset = this.defaultRuleset; } | ||
} | ||
verify(html, ruleset = this.defaultRuleset) { | ||
if (Object.keys(ruleset).length === 0) { | ||
ruleset = this.defaultRuleset; | ||
} | ||
html = html.replace(/^\s*<!--\s*htmlhint\s+([^\r\n]+?)\s*-->/i, function (all, strRuleset) { | ||
strRuleset.replace(/(?:^|,)\s*([^:,]+)\s*(?:\:\s*([^,\s]+))?/g, function (all, ruleId, value) { | ||
ruleset[ruleId] = types_1.isRuleSeverity(value) ? value : 'error'; | ||
html = html.replace(/^\s*<!--\s*htmlhint\s+([^\r\n]+?)\s*-->/i, (all, strRuleset) => { | ||
strRuleset.replace(/(?:^|,)\s*([^:,]+)\s*(?:\:\s*([^,\s]+))?/g, (all, ruleId, value) => { | ||
ruleset[ruleId] = | ||
value !== undefined && value.length > 0 ? JSON.parse(value) : true; | ||
return ''; | ||
@@ -42,15 +41,10 @@ }); | ||
}); | ||
var parser = new htmlparser_1.default(); | ||
var reporter = new reporter_1.default(html, ruleset); | ||
var rules = this.rules; | ||
var rule; | ||
for (var id in ruleset) { | ||
const parser = new htmlparser_1.default(); | ||
const reporter = new reporter_1.default(html, ruleset); | ||
const rules = this.rules; | ||
let rule; | ||
for (const id in ruleset) { | ||
rule = rules[id]; | ||
var ruleConfig = ruleset[id]; | ||
var ruleSeverity = Array.isArray(ruleConfig) | ||
? ruleConfig[0] | ||
: ruleConfig; | ||
if (rule !== undefined && ruleSeverity !== 'off') { | ||
var reportMessageCallback = reporter[ruleSeverity].bind(reporter); | ||
rule.init(parser, reportMessageCallback, Array.isArray(ruleConfig) ? ruleConfig[1] : undefined); | ||
if (rule !== undefined && ruleset[id] !== false) { | ||
rule.init(parser, reporter, ruleset[id]); | ||
} | ||
@@ -60,7 +54,6 @@ } | ||
return reporter.messages; | ||
}; | ||
HTMLHintCore.prototype.format = function (arrMessages, options) { | ||
if (options === void 0) { options = {}; } | ||
var arrLogs = []; | ||
var colors = { | ||
} | ||
format(arrMessages, options = {}) { | ||
const arrLogs = []; | ||
const colors = { | ||
white: '', | ||
@@ -77,12 +70,12 @@ grey: '', | ||
} | ||
var indent = options.indent || 0; | ||
arrMessages.forEach(function (hint) { | ||
var leftWindow = 40; | ||
var rightWindow = leftWindow + 20; | ||
var evidence = hint.evidence; | ||
var line = hint.line; | ||
var col = hint.col; | ||
var evidenceCount = evidence.length; | ||
var leftCol = col > leftWindow + 1 ? col - leftWindow : 1; | ||
var rightCol = evidence.length > col + rightWindow ? col + rightWindow : evidenceCount; | ||
const indent = options.indent || 0; | ||
arrMessages.forEach((hint) => { | ||
const leftWindow = 40; | ||
const rightWindow = leftWindow + 20; | ||
let evidence = hint.evidence; | ||
const line = hint.line; | ||
const col = hint.col; | ||
const evidenceCount = evidence.length; | ||
let leftCol = col > leftWindow + 1 ? col - leftWindow : 1; | ||
let rightCol = evidence.length > col + rightWindow ? col + rightWindow : evidenceCount; | ||
if (col < leftWindow + 1) { | ||
@@ -93,3 +86,3 @@ rightCol += leftWindow - col + 1; | ||
if (leftCol > 1) { | ||
evidence = "..." + evidence; | ||
evidence = `...${evidence}`; | ||
leftCol -= 3; | ||
@@ -100,16 +93,15 @@ } | ||
} | ||
arrLogs.push(colors.white + repeatStr(indent) + "L" + line + " |" + colors.grey + evidence + colors.reset); | ||
var pointCol = col - leftCol; | ||
var match = evidence.substring(0, pointCol).match(/[^\u0000-\u00ff]/g); | ||
arrLogs.push(`${colors.white + repeatStr(indent)}L${line} |${colors.grey}${evidence}${colors.reset}`); | ||
let pointCol = col - leftCol; | ||
const match = evidence.substring(0, pointCol).match(/[^\u0000-\u00ff]/g); | ||
if (match !== null) { | ||
pointCol += match.length; | ||
} | ||
arrLogs.push(colors.white + | ||
arrLogs.push(`${colors.white + | ||
repeatStr(indent) + | ||
repeatStr(String(line).length + 3 + pointCol) + "^ " + colors.red + hint.message + " (" + hint.rule.id + ")" + colors.reset); | ||
repeatStr(String(line).length + 3 + pointCol)}^ ${colors.red}${hint.message} (${hint.rule.id})${colors.reset}`); | ||
}); | ||
return arrLogs; | ||
}; | ||
return HTMLHintCore; | ||
}()); | ||
} | ||
} | ||
function repeatStr(n, str) { | ||
@@ -119,5 +111,5 @@ return new Array(n + 1).join(str || ' '); | ||
exports.HTMLHint = new HTMLHintCore(); | ||
Object.keys(HTMLRules).forEach(function (key) { | ||
Object.keys(HTMLRules).forEach((key) => { | ||
exports.HTMLHint.addRule(HTMLRules[key]); | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29yZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb3JlL2NvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsMkNBQXFDO0FBOEtQLHFCQTlLdkIsb0JBQVUsQ0E4S3VCO0FBN0t4Qyx1Q0FBNEQ7QUE2S3hDLG1CQTdLYixrQkFBUSxDQTZLYTtBQTVLNUIsbUNBQW9DO0FBNEszQiw4QkFBUztBQTNLbEIsaUNBQTJFO0FBTzNFO0lBQUE7UUFDUyxVQUFLLEdBQTJCLEVBQUUsQ0FBQTtRQUN6QixtQkFBYyxHQUFZO1lBQ3hDLG1CQU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LParser = (function () { | ||
function HTMLParser() { | ||
class HTMLParser { | ||
constructor() { | ||
this._listeners = {}; | ||
@@ -10,29 +10,28 @@ this._mapCdataTags = this.makeMap('script,style'); | ||
} | ||
HTMLParser.prototype.makeMap = function (str) { | ||
var obj = {}; | ||
var items = str.split(','); | ||
for (var i = 0; i < items.length; i++) { | ||
makeMap(str) { | ||
const obj = {}; | ||
const items = str.split(','); | ||
for (let i = 0; i < items.length; i++) { | ||
obj[items[i]] = true; | ||
} | ||
return obj; | ||
}; | ||
HTMLParser.prototype.parse = function (html) { | ||
var _this = this; | ||
var mapCdataTags = this._mapCdataTags; | ||
var regTag = /<(?:\/([^\s>]+)\s*|!--([\s\S]*?)--|!([^>]*?)|([\w\-:]+)((?:\s+[^\s"'>\/=\x00-\x0F\x7F\x80-\x9F]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'>]*))?)*?)\s*(\/?))>/g; | ||
var regAttr = /\s*([^\s"'>\/=\x00-\x0F\x7F\x80-\x9F]+)(?:\s*=\s*(?:(")([^"]*)"|(')([^']*)'|([^\s"'>]*)))?/g; | ||
var regLine = /\r?\n/g; | ||
var match; | ||
var matchIndex; | ||
var lastIndex = 0; | ||
var tagName; | ||
var arrAttrs; | ||
var tagCDATA = null; | ||
var attrsCDATA; | ||
var arrCDATA = []; | ||
var lastCDATAIndex = 0; | ||
var text; | ||
var lastLineIndex = 0; | ||
var line = 1; | ||
var arrBlocks = this._arrBlocks; | ||
} | ||
parse(html) { | ||
const mapCdataTags = this._mapCdataTags; | ||
const regTag = /<(?:\/([^\s>]+)\s*|!--([\s\S]*?)--|!([^>]*?)|([\w\-:]+)((?:\s+[^\s"'>\/=\x00-\x0F\x7F\x80-\x9F]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'>]*))?)*?)\s*(\/?))>/g; | ||
const regAttr = /\s*([^\s"'>\/=\x00-\x0F\x7F\x80-\x9F]+)(?:\s*=\s*(?:(")([^"]*)"|(')([^']*)'|([^\s"'>]*)))?/g; | ||
const regLine = /\r?\n/g; | ||
let match; | ||
let matchIndex; | ||
let lastIndex = 0; | ||
let tagName; | ||
let arrAttrs; | ||
let tagCDATA = null; | ||
let attrsCDATA; | ||
let arrCDATA = []; | ||
let lastCDATAIndex = 0; | ||
let text; | ||
let lastLineIndex = 0; | ||
let line = 1; | ||
const arrBlocks = this._arrBlocks; | ||
this.fire('start', { | ||
@@ -43,4 +42,11 @@ pos: 0, | ||
}); | ||
var saveBlock = function (type, raw, pos, data) { | ||
var col = pos - lastLineIndex + 1; | ||
const isMapCdataTagsRequired = () => { | ||
const attrType = arrAttrs.find((attr) => attr.name === 'type') || { | ||
value: '', | ||
}; | ||
return (mapCdataTags[tagName] && | ||
attrType.value.indexOf('text/ng-template') === -1); | ||
}; | ||
const saveBlock = (type, raw, pos, data) => { | ||
const col = pos - lastLineIndex + 1; | ||
if (data === undefined) { | ||
@@ -54,5 +60,4 @@ data = {}; | ||
arrBlocks.push(data); | ||
_this.fire(type, data); | ||
var lineMatch; | ||
while ((lineMatch = regLine.exec(raw))) { | ||
this.fire(type, data); | ||
while (regLine.exec(raw)) { | ||
line++; | ||
@@ -98,8 +103,8 @@ lastLineIndex = pos + regLine.lastIndex; | ||
arrAttrs = []; | ||
var attrs = match[5]; | ||
var attrMatch = void 0; | ||
var attrMatchCount = 0; | ||
const attrs = match[5]; | ||
let attrMatch; | ||
let attrMatchCount = 0; | ||
while ((attrMatch = regAttr.exec(attrs))) { | ||
var name_1 = attrMatch[1]; | ||
var quote = attrMatch[2] | ||
const name = attrMatch[1]; | ||
const quote = attrMatch[2] | ||
? attrMatch[2] | ||
@@ -109,3 +114,3 @@ : attrMatch[4] | ||
: ''; | ||
var value = attrMatch[3] | ||
const value = attrMatch[3] | ||
? attrMatch[3] | ||
@@ -118,3 +123,3 @@ : attrMatch[5] | ||
arrAttrs.push({ | ||
name: name_1, | ||
name: name, | ||
value: value, | ||
@@ -133,3 +138,3 @@ quote: quote, | ||
}); | ||
if (mapCdataTags[tagName]) { | ||
if (isMapCdataTagsRequired()) { | ||
tagCDATA = tagName; | ||
@@ -162,8 +167,8 @@ attrsCDATA = arrAttrs.concat(); | ||
}); | ||
}; | ||
HTMLParser.prototype.addListener = function (types, listener) { | ||
var _listeners = this._listeners; | ||
var arrTypes = types.split(/[,\s]/); | ||
var type; | ||
for (var i = 0, l = arrTypes.length; i < l; i++) { | ||
} | ||
addListener(types, listener) { | ||
const _listeners = this._listeners; | ||
const arrTypes = types.split(/[,\s]/); | ||
let type; | ||
for (let i = 0, l = arrTypes.length; i < l; i++) { | ||
type = arrTypes[i]; | ||
@@ -175,4 +180,4 @@ if (_listeners[type] === undefined) { | ||
} | ||
}; | ||
HTMLParser.prototype.fire = function (type, data) { | ||
} | ||
fire(type, data) { | ||
if (data === undefined) { | ||
@@ -182,5 +187,5 @@ data = {}; | ||
data.type = type; | ||
var listeners = []; | ||
var listenersType = this._listeners[type]; | ||
var listenersAll = this._listeners['all']; | ||
let listeners = []; | ||
const listenersType = this._listeners[type]; | ||
const listenersAll = this._listeners['all']; | ||
if (listenersType !== undefined) { | ||
@@ -192,3 +197,3 @@ listeners = listeners.concat(listenersType); | ||
} | ||
var lastEvent = this.lastEvent; | ||
const lastEvent = this.lastEvent; | ||
if (lastEvent !== null) { | ||
@@ -199,10 +204,10 @@ delete lastEvent['lastEvent']; | ||
this.lastEvent = data; | ||
for (var i = 0, l = listeners.length; i < l; i++) { | ||
for (let i = 0, l = listeners.length; i < l; i++) { | ||
listeners[i].call(this, data); | ||
} | ||
}; | ||
HTMLParser.prototype.removeListener = function (type, listener) { | ||
var listenersType = this._listeners[type]; | ||
} | ||
removeListener(type, listener) { | ||
const listenersType = this._listeners[type]; | ||
if (listenersType !== undefined) { | ||
for (var i = 0, l = listenersType.length; i < l; i++) { | ||
for (let i = 0, l = listenersType.length; i < l; i++) { | ||
if (listenersType[i] === listener) { | ||
@@ -214,9 +219,9 @@ listenersType.splice(i, 1); | ||
} | ||
}; | ||
HTMLParser.prototype.fixPos = function (event, index) { | ||
var text = event.raw.substr(0, index); | ||
var arrLines = text.split(/\r?\n/); | ||
var lineCount = arrLines.length - 1; | ||
var line = event.line; | ||
var col; | ||
} | ||
fixPos(event, index) { | ||
const text = event.raw.substr(0, index); | ||
const arrLines = text.split(/\r?\n/); | ||
const lineCount = arrLines.length - 1; | ||
let line = event.line; | ||
let col; | ||
if (lineCount > 0) { | ||
@@ -233,7 +238,7 @@ line += lineCount; | ||
}; | ||
}; | ||
HTMLParser.prototype.getMapAttrs = function (arrAttrs) { | ||
var mapAttrs = {}; | ||
var attr; | ||
for (var i = 0, l = arrAttrs.length; i < l; i++) { | ||
} | ||
getMapAttrs(arrAttrs) { | ||
const mapAttrs = {}; | ||
let attr; | ||
for (let i = 0, l = arrAttrs.length; i < l; i++) { | ||
attr = arrAttrs[i]; | ||
@@ -243,6 +248,5 @@ mapAttrs[attr.name] = attr.value; | ||
return mapAttrs; | ||
}; | ||
return HTMLParser; | ||
}()); | ||
} | ||
} | ||
exports.default = HTMLParser; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHRtbHBhcnNlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb3JlL2h0bWxwYXJzZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUF3QkE7SUFPRTtRQUNFLElBQUksQ0FBQyxVQUFVLEdBQUcsRUFBRSxDQUFBO1FBQ3BCLElBQUksQ0FBQyxhQUFhLEdBQUcsSUFBSSxDQUFDLE9BQU8sQ0FBQyxjQUFjLENBQUMsQ0FBQTtRQUNqRCxJQUFJLENBQUMsVUFBVSxHQUFHLEVBQUUsQ0FBQTtRQUNwQixJQUFJLENBQUMsU0FBUyxHQUFHLElBQUksQ0FBQTtJQUN2QixDQUFDO0lBRU0sNEJBQU8sR0FBZCxVQUNFLEdBQVc7UUFJWCxJQUFNLEdBQUcsR0FBK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BSyxDQUFDLEdBQUcsR0FBRyxLQUFLLENBQUE7U0FDeEI7UUFFRCxPQUFPO1lBQ0wsSUFBSSxFQUFFLElBQUk7WUFDVixHQUFHLEVBQUUsR0FBRztTQUNULENBQUE7SUFDSCxDQUFDO0lBRU0sV0FBVyxDQUFDLFFBQWdCO1FBR2pDLE1BQU0sUUFBUSxHQUErQixFQUFFLENBQUE7UUFDL0MsSUFBSSxJQUFVLENBQUE7UUFFZCxLQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsUUFBUSxDQUFDLE1BQU0sRUFBRSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsRUFBRSxFQUFFO1lBQy9DLElBQUksR0FBRyxRQUFRLENBQUMsQ0FBQyxDQUFDLENBQUE7WUFDbEIsUUFBUSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFBO1NBQ2pDO1FBRUQsT0FBTyxRQUFRLENBQUE7SUFDakIsQ0FBQztDQUNGO0FBOVNELDZCQThTQyJ9 |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var Reporter = (function () { | ||
function Reporter(html, ruleset) { | ||
class Reporter { | ||
constructor(html, ruleset) { | ||
this.html = html; | ||
this.lines = html.split(/\r?\n/); | ||
var match = /\r?\n/.exec(html); | ||
const match = /\r?\n/.exec(html); | ||
this.brLen = match !== null ? match[0].length : 0; | ||
@@ -12,17 +12,17 @@ this.ruleset = ruleset; | ||
} | ||
Reporter.prototype.info = function (message, line, col, rule, raw) { | ||
info(message, line, col, rule, raw) { | ||
this.report("info", message, line, col, rule, raw); | ||
}; | ||
Reporter.prototype.warn = function (message, line, col, rule, raw) { | ||
} | ||
warn(message, line, col, rule, raw) { | ||
this.report("warning", message, line, col, rule, raw); | ||
}; | ||
Reporter.prototype.error = function (message, line, col, rule, raw) { | ||
} | ||
error(message, line, col, rule, raw) { | ||
this.report("error", message, line, col, rule, raw); | ||
}; | ||
Reporter.prototype.report = function (type, message, line, col, rule, raw) { | ||
var lines = this.lines; | ||
var brLen = this.brLen; | ||
var evidence = ''; | ||
var evidenceLen = 0; | ||
for (var i = line - 1, lineCount = lines.length; i < lineCount; i++) { | ||
} | ||
report(type, message, line, col, rule, raw) { | ||
const lines = this.lines; | ||
const brLen = this.brLen; | ||
let evidence = ''; | ||
let evidenceLen = 0; | ||
for (let i = line - 1, lineCount = lines.length; i < lineCount; i++) { | ||
evidence = lines[i]; | ||
@@ -51,9 +51,8 @@ evidenceLen = evidence.length; | ||
description: rule.description, | ||
link: "https://github.com/thedaviddias/HTMLHint/wiki/" + rule.id, | ||
link: `https://github.com/thedaviddias/HTMLHint/wiki/${rule.id}`, | ||
}, | ||
}); | ||
}; | ||
return Reporter; | ||
}()); | ||
} | ||
} | ||
exports.default = Reporter; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVwb3J0ZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29yZS9yZXBvcnRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQVVBO0lBT0Usa0JBQW1CLElBQVksRUFBRSxPQUFnQjtRQUMvQyxJQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQTtRQUNoQixJQUFJLENBQUMsS0FBSyxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUMsT0FBTyxDQUFDLENBQUE7UUFDaEMsSUFBTSxLQUFLLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQTtRQUVoQyxJQUFJLENBQUMsS0FBSyxHQUFHLEtBQUssS0FBSyxJQUFJLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQTtRQUNqRCxJQUFJLENBQUMsT0FBTyxHQ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LEVBQUUsR0FBRztZQUNSLFFBQVEsRUFBRSxRQUFRO1lBQ2xCLElBQUksRUFBRSxJQUFJO1lBQ1YsR0FBRyxFQUFFLEdBQUc7WUFDUixJQUFJLEVBQUU7Z0JBQ0osRUFBRSxFQUFFLElBQUksQ0FBQyxFQUFFO2dCQUNYLFdBQVcsRUFBRSxJQUFJLENBQUMsV0FBVztnQkFDN0IsSUFBSSxFQUFFLGlEQUFpRCxJQUFJLENBQUMsRUFBRSxFQUFFO2FBQ3pEO1NBQ1YsQ0FBQyxDQUFBO0lBQ0osQ0FBQztDQUNGO0FBeEZELDJCQXdGQyJ9 |
@@ -6,11 +6,10 @@ "use strict"; | ||
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 (parser, reportMessageCallback) { | ||
var _this = this; | ||
parser.addListener('tagstart', function (event) { | ||
var tagName = event.tagName.toLowerCase(); | ||
var mapAttrs = parser.getMapAttrs(event.attrs); | ||
var col = event.col + tagName.length + 1; | ||
var selector; | ||
init(parser, reporter) { | ||
parser.addListener('tagstart', (event) => { | ||
const tagName = event.tagName.toLowerCase(); | ||
const mapAttrs = parser.getMapAttrs(event.attrs); | ||
const col = event.col + tagName.length + 1; | ||
let selector; | ||
if (tagName === 'img' && !('alt' in mapAttrs)) { | ||
reportMessageCallback('An alt attribute must be present on <img> elements.', event.line, col, _this, event.raw); | ||
reporter.warn('An alt attribute must be present on <img> elements.', event.line, col, this, event.raw); | ||
} | ||
@@ -21,3 +20,3 @@ else if ((tagName === 'area' && 'href' in mapAttrs) || | ||
selector = tagName === 'area' ? 'area[href]' : 'input[type=image]'; | ||
reportMessageCallback("The alt attribute of " + selector + " must have a value.", event.line, col, _this, event.raw); | ||
reporter.warn(`The alt attribute of ${selector} must have a value.`, event.line, col, this, event.raw); | ||
} | ||
@@ -28,2 +27,2 @@ } | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWx0LXJ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DMUMsSUFBSSxRQUFRLENBQUE7WUFFWixJQUFJLE9BQU8sS0FBSyxLQUFLLElBQUksQ0FBQyxDQUFDLEtBQUssSUFBSSxRQUFRLENBQUMsRUFBRTtnQkFDN0MsUUFBUSxDQUFDLElBQUksQ0FDWCxxREFBcUQsRUFDckQsS0FBSyxDQUFDLElBQUksRUFDVixHQUFHLEVBQ0gsSUFBSSxFQUNKLEtBQUssQ0FBQyxHQUFHLENBQ1YsQ0FBQTthQUNGO2lCQUFNLElBQ0wsQ0FBQyxPQUFPLEtBQUssTUFBTSxJQUFJLE1BQU0sSUFBSSxRQUFRLENBQUM7Z0JBQzFDLENBQUMsT0FBTyxLQUFLLE9BQU8sSUFBSSxRQUFRLENBQUMsTUFBTSxDQUFDLEtBQUssT0FBTyxDQUFDLEVBQ3JEO2dCQUNBLElBQUksQ0FBQyxDQUFDLEtBQUssSUFBSSxRQUFRLENBQUMsSUFBSSxRQUFRLENBQUMsS0FBSyxDQUFDLEtBQUssRUFBRSxFQUFFO29CQUNsRCxRQUFRLEdBQUcsT0FBTyxLQUFLLE1BQU0sQ0FBQyxDQUFDLENBQUMsWUFBWSxDQUFDLENBQUMsQ0FBQyxtQkFBbUIsQ0FBQTtvQkFDbEUsUUFBUSxDQUFDLElBQUksQ0FDWCx3QkFBd0IsUUFBUSxxQkFBcUIsRUFDckQsS0FBSyxDQUFDLElBQUksRUFDVixHQUFHLEVBQ0gsSUFBSSxFQUNKLEtBQUssQ0FBQyxHQUFHLENBQ1YsQ0FBQTtpQkFDRjthQUNGO1FBQ0gsQ0FBQyxDQUFDLENBQUE7SUFDSixDQUFDO0NBQ00sQ0FBQSJ9 |
@@ -9,11 +9,11 @@ "use strict"; | ||
} | ||
var firstComparisonChar = comparison[0]; | ||
var lastComparisonChar = comparison[comparison.length - 1]; | ||
var secondToLastComparisonChar = comparison[comparison.length - 2]; | ||
var comparisonIsRegex = firstComparisonChar === '/' && | ||
const firstComparisonChar = comparison[0]; | ||
const lastComparisonChar = comparison[comparison.length - 1]; | ||
const secondToLastComparisonChar = comparison[comparison.length - 2]; | ||
const comparisonIsRegex = firstComparisonChar === '/' && | ||
(lastComparisonChar === '/' || | ||
(secondToLastComparisonChar === '/' && lastComparisonChar === 'i')); | ||
var hasCaseInsensitiveFlag = comparisonIsRegex && lastComparisonChar === 'i'; | ||
const hasCaseInsensitiveFlag = comparisonIsRegex && lastComparisonChar === 'i'; | ||
if (comparisonIsRegex) { | ||
var valueMatches = hasCaseInsensitiveFlag | ||
const valueMatches = hasCaseInsensitiveFlag | ||
? new RegExp(comparison.slice(1, -2), 'i').test(value) | ||
@@ -28,20 +28,15 @@ : new RegExp(comparison.slice(1, -1)).test(value); | ||
description: 'All attribute names must be in lowercase.', | ||
init: function (parser, reportMessageCallback, options) { | ||
var _this = this; | ||
var _a; | ||
var exceptions = (_a = options === null || options === void 0 ? void 0 : options.exceptions) !== null && _a !== void 0 ? _a : []; | ||
parser.addListener('tagstart', function (event) { | ||
var attrs = event.attrs; | ||
var attr; | ||
var col = event.col + event.tagName.length + 1; | ||
var _loop_1 = function (i, l) { | ||
init(parser, reporter, options) { | ||
const exceptions = Array.isArray(options) ? options : []; | ||
parser.addListener('tagstart', (event) => { | ||
const attrs = event.attrs; | ||
let attr; | ||
const col = event.col + event.tagName.length + 1; | ||
for (let i = 0, l = attrs.length; i < l; i++) { | ||
attr = attrs[i]; | ||
var attrName = attr.name; | ||
if (!exceptions.find(function (exp) { return testAgainstStringOrRegExp(attrName, exp); }) && | ||
const attrName = attr.name; | ||
if (!exceptions.find((exp) => testAgainstStringOrRegExp(attrName, exp)) && | ||
attrName !== attrName.toLowerCase()) { | ||
reportMessageCallback("The attribute name of [ " + attrName + " ] must be in lowercase.", event.line, col + attr.index, _this, attr.raw); | ||
reporter.error(`The attribute name of [ ${attrName} ] must be in lowercase.`, event.line, col + attr.index, this, attr.raw); | ||
} | ||
}; | ||
for (var i = 0, l = attrs.length; i < l; i++) { | ||
_loop_1(i, l); | ||
} | ||
@@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UFDLEtBQUssRUFDaEIsSUFBSSxFQUNKLElBQUksQ0FBQyxHQUFHLENBQ1QsQ0FBQTtpQkFDRjthQUNGO1FBQ0gsQ0FBQyxDQUFDLENBQUE7SUFDSixDQUFDO0NBQ00sQ0FBQSJ9 |
@@ -6,15 +6,14 @@ "use strict"; | ||
description: 'Elements cannot have duplicate attributes.', | ||
init: function (parser, reportMessageCallback) { | ||
var _this = this; | ||
parser.addListener('tagstart', function (event) { | ||
var attrs = event.attrs; | ||
var attr; | ||
var attrName; | ||
var col = event.col + event.tagName.length + 1; | ||
var mapAttrName = {}; | ||
for (var i = 0, l = attrs.length; i < l; i++) { | ||
init(parser, reporter) { | ||
parser.addListener('tagstart', (event) => { | ||
const attrs = event.attrs; | ||
let attr; | ||
let attrName; | ||
const col = event.col + event.tagName.length + 1; | ||
const mapAttrName = {}; | ||
for (let i = 0, l = attrs.length; i < l; i++) { | ||
attr = attrs[i]; | ||
attrName = attr.name; | ||
if (mapAttrName[attrName] === true) { | ||
reportMessageCallback("Duplicate of attribute name [ " + attr.name + " ] was found.", event.line, col + attr.index, _this, attr.raw); | ||
reporter.error(`Duplicate of attribute name [ ${attr.name} ] was found.`, event.line, col + attr.index, this, attr.raw); | ||
} | ||
@@ -26,2 +25,2 @@ mapAttrName[attrName] = true; | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXR0ci1uby1kdXBsaWNhdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb3JlL3J1bGVzL2F0dHItbm8tZHVwbGljYXRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFFQSxrQkFBZTtJQUNiLEVBQUUsRUFBRSxxQkFBcUI7SUFDekIsV0FBVyxFQUFFLDRDQUE0QztJQUN6RCxJQUFJLEVBQUosVUFBSyxNQUFNLEVBQUUscUJBQXFCO1FBQWxDLGlCQXlCQ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sR0FBRyxDQUNULENBQUE7aUJBQ0Y7Z0JBQ0QsV0FBVyxDQUFDLFFBQVEsQ0FBQyxHQUFHLElBQUksQ0FBQTthQUM3QjtRQUNILENBQUMsQ0FBQyxDQUFBO0lBQ0osQ0FBQztDQUNNLENBQUEifQ== |
@@ -6,14 +6,12 @@ "use strict"; | ||
description: 'No spaces between attribute names and values.', | ||
init: function (parser, reportMessageCallback, options) { | ||
var _this = this; | ||
var _a; | ||
var exceptions = (_a = options === null || options === void 0 ? void 0 : options.exceptions) !== null && _a !== void 0 ? _a : []; | ||
parser.addListener('tagstart', function (event) { | ||
var attrs = event.attrs; | ||
var col = event.col + event.tagName.length + 1; | ||
for (var i = 0; i < attrs.length; i++) { | ||
init(parser, reporter, options) { | ||
const exceptions = Array.isArray(options) ? options : []; | ||
parser.addListener('tagstart', (event) => { | ||
const attrs = event.attrs; | ||
const col = event.col + event.tagName.length + 1; | ||
for (let i = 0; i < attrs.length; i++) { | ||
if (exceptions.indexOf(attrs[i].name) === -1) { | ||
var match = /(\s*)=(\s*)/.exec(attrs[i].raw.trim()); | ||
const match = /(\s*)=(\s*)/.exec(attrs[i].raw.trim()); | ||
if (match && (match[1].length !== 0 || match[2].length !== 0)) { | ||
reportMessageCallback("The attribute '" + attrs[i].name + "' must not have spaces between the name and value.", event.line, col + attrs[i].index, _this, attrs[i].raw); | ||
reporter.error(`The attribute '${attrs[i].name}' must not have spaces between the name and value.`, event.line, col + attrs[i].index, this, attrs[i].raw); | ||
} | ||
@@ -25,2 +23,2 @@ } | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXR0ci1uby11bm5lY2Vzc2FyeS13aGl0ZXNwYWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvcmUvcnVsZXMvYXR0ci1uby11bm5lY2Vzc2FyeS13aGl0ZXNwYWNlLnRzIl0sIm5hbWVzIjpbXSwibW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LENBQUE7WUFFaEQsS0FBSyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxHQUFHLEtBQUssQ0FBQyxNQUFNLEVBQUUsQ0FBQyxFQUFFLEVBQUU7Z0JBQ3JDLElBQUksVUFBVSxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDLEVBQUU7b0JBQzVDLE1BQU0sS0FBSyxHQUFHLGFBQWEsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxJQUFJLEVBQUUsQ0FBQyxDQUFBO29CQUNyRCxJQUFJLEtBQUssSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxNQUFNLEtBQUssQ0FBQyxJQUFJLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxNQUFNLEtBQUssQ0FBQyxDQUFDLEVBQUU7d0JBQzdELFFBQVEsQ0FBQyxLQUFLLENBQ1osa0JBQWtCLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxJQUFJLG9EQUFvRCxFQUNuRixLQUFLLENBQUMsSUFBSSxFQUNWLEdBQUcsR0FBRyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsS0FBSyxFQUNwQixJQUFJLEVBQ0osS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLEdBQUcsQ0FDYixDQUFBO3FCQUNGO2lCQUNGO2FBQ0Y7UUFDSCxDQUFDLENBQUMsQ0FBQTtJQUNKLENBQUM7Q0FDTSxDQUFBIn0= |
@@ -6,6 +6,5 @@ "use strict"; | ||
description: 'Attribute tags must be in proper order.', | ||
init: function (parser, reportMessageCallback) { | ||
var _this = this; | ||
var orderMap = {}; | ||
var sortOrder = [ | ||
init(parser, reporter) { | ||
const orderMap = {}; | ||
const sortOrder = [ | ||
'class', | ||
@@ -23,13 +22,13 @@ 'id', | ||
]; | ||
for (var i = 0; i < sortOrder.length; i++) { | ||
for (let i = 0; i < sortOrder.length; i++) { | ||
orderMap[sortOrder[i]] = i; | ||
} | ||
parser.addListener('tagstart', function (event) { | ||
var attrs = event.attrs; | ||
var listOfAttributes = []; | ||
for (var i = 0; i < attrs.length; i++) { | ||
parser.addListener('tagstart', (event) => { | ||
const attrs = event.attrs; | ||
const listOfAttributes = []; | ||
for (let i = 0; i < attrs.length; i++) { | ||
listOfAttributes.push(attrs[i].name); | ||
} | ||
var originalAttrs = JSON.stringify(listOfAttributes); | ||
listOfAttributes.sort(function (a, b) { | ||
const originalAttrs = JSON.stringify(listOfAttributes); | ||
listOfAttributes.sort((a, b) => { | ||
if (orderMap[a] == undefined && orderMap[b] == undefined) { | ||
@@ -47,3 +46,3 @@ return 0; | ||
if (originalAttrs !== JSON.stringify(listOfAttributes)) { | ||
reportMessageCallback("Inaccurate order " + originalAttrs + " should be in hierarchy " + JSON.stringify(listOfAttributes) + " ", event.line, event.col, _this, event.raw); | ||
reporter.error(`Inaccurate order ${originalAttrs} should be in hierarchy ${JSON.stringify(listOfAttributes)} `, event.line, event.col, this, event.raw); | ||
} | ||
@@ -53,2 +52,2 @@ }); | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXR0ci1zb3J0ZWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY29yZS9ydWxlcy9hdHRyLXNvcnRlZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBLGtCQUFlO0lBQ2IsRUFBRSxFQUFFLGFBQWE7SUFDakIsV0FBVyxFQUFFLHlDQUF5QztJQUN0RCxJQUFJLEVBQUosVUFBSyxNQUFNLEVBQUUscUJBQXFCO1FBQWxDLGlCQXFEQztRQXBEQyxJQUFNLFFBQVEsR0FBOEIsRUFBRSxDQUFBO1FBQzlDLElBQU0sU0FBUyx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O2lCQUNUO2dCQUNELElBQUksUUFBUSxDQUFDLENBQUMsQ0FBQyxJQUFJLFNBQVMsRUFBRTtvQkFDNUIsT0FBTyxDQUFDLENBQUE7aUJBQ1Q7cUJBQU0sSUFBSSxRQUFRLENBQUMsQ0FBQyxDQUFDLElBQUksU0FBUyxFQUFFO29CQUNuQyxPQUFPLENBQUMsQ0FBQyxDQUFBO2lCQUNWO2dCQUNELE9BQU8sUUFBUSxDQUFDLENBQUMsQ0FBQyxHQUFHLFFBQVEsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUMsYUFBYSxDQUFDLENBQUMsQ0FBQyxDQUFBO1lBQ3hELENBQUMsQ0FBQyxDQUFBO1lBRUYsSUFBSSxhQUFhLEtBQUssSUFBSSxDQUFDLFNBQVMsQ0FBQyxnQkFBZ0IsQ0FBQyxFQUFFO2dCQUN0RCxRQUFRLENBQUMsS0FBSyxDQUNaLG9CQUFvQixhQUFhLDJCQUEyQixJQUFJLENBQUMsU0FBUyxDQUN4RSxnQkFBZ0IsQ0FDakIsR0FBRyxFQUNKLEtBQUssQ0FBQyxJQUFJLEVBQ1YsS0FBSyxDQUFDLEdBQUcsRUFDVCxJQUFJLEVBQ0osS0FBSyxDQUFDLEdBQUcsQ0FDVixDQUFBO2FBQ0Y7UUFDSCxDQUFDLENBQUMsQ0FBQTtJQUNKLENBQUM7Q0FDTSxDQUFBIn0= |
@@ -6,18 +6,17 @@ "use strict"; | ||
description: 'Attribute values cannot contain unsafe chars.', | ||
init: function (parser, reportMessageCallback) { | ||
var _this = this; | ||
parser.addListener('tagstart', function (event) { | ||
var attrs = event.attrs; | ||
var attr; | ||
var col = event.col + event.tagName.length + 1; | ||
var regUnsafe = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; | ||
var match; | ||
for (var i = 0, l = attrs.length; i < l; i++) { | ||
init(parser, reporter) { | ||
parser.addListener('tagstart', (event) => { | ||
const attrs = event.attrs; | ||
let attr; | ||
const col = event.col + event.tagName.length + 1; | ||
const regUnsafe = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; | ||
let match; | ||
for (let i = 0, l = attrs.length; i < l; i++) { | ||
attr = attrs[i]; | ||
match = regUnsafe.exec(attr.value); | ||
if (match !== null) { | ||
var unsafeCode = escape(match[0]) | ||
const unsafeCode = escape(match[0]) | ||
.replace(/%u/, '\\u') | ||
.replace(/%/, '\\x'); | ||
reportMessageCallback("The value of attribute [ " + attr.name + " ] cannot contain an unsafe char [ " + unsafeCode + " ].", event.line, col + attr.index, _this, attr.raw); | ||
reporter.warn(`The value of attribute [ ${attr.name} ] cannot contain an unsafe char [ ${unsafeCode} ].`, event.line, col + attr.index, this, attr.raw); | ||
} | ||
@@ -28,2 +27,2 @@ } | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXR0ci11bnNhZmUtY2hhcnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY29yZS9ydWxlcy9hdHRyLXVuc2FmZS1jaGFycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBLGtCQUFlO0lBQ2IsRUFBRSxFQUFFLG1CQUFtQjtJQUN2QixXQUFXLEVBQUUsK0NBQStDO0lBQzVELElBQUksWUFBQyxNQUFNLEVBQUUscUJBQXFCO1FBQWxDLGlCQTRCQztRQTNCQyxNQUFNLENBQUMsV0FBVyxDQUFDLFVBQVUsRUFBRSxVQUFDLEtBQUs7WUFDbkMsSUFBTSxLQUFLLEdBQUcsS0FBSyxDQUFDLEtBQUssQ0FBQTtZQUN6QixJQUFJLElBQUksQ0FBQTtZQU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Q0FBQyxDQUFBO29CQUN0QixRQUFRLENBQUMsSUFBSSxDQUNYLDRCQUE0QixJQUFJLENBQUMsSUFBSSxzQ0FBc0MsVUFBVSxLQUFLLEVBQzFGLEtBQUssQ0FBQyxJQUFJLEVBQ1YsR0FBRyxHQUFHLElBQUksQ0FBQyxLQUFLLEVBQ2hCLElBQUksRUFDSixJQUFJLENBQUMsR0FBRyxDQUNULENBQUE7aUJBQ0Y7YUFDRjtRQUNILENBQUMsQ0FBQyxDQUFBO0lBQ0osQ0FBQztDQUNNLENBQUEifQ== |
@@ -6,13 +6,12 @@ "use strict"; | ||
description: 'Attribute values must be in double quotes.', | ||
init: function (parser, reportMessageCallback) { | ||
var _this = this; | ||
parser.addListener('tagstart', function (event) { | ||
var attrs = event.attrs; | ||
var attr; | ||
var col = event.col + event.tagName.length + 1; | ||
for (var i = 0, l = attrs.length; i < l; i++) { | ||
init(parser, reporter) { | ||
parser.addListener('tagstart', (event) => { | ||
const attrs = event.attrs; | ||
let attr; | ||
const col = event.col + event.tagName.length + 1; | ||
for (let i = 0, l = attrs.length; i < l; i++) { | ||
attr = attrs[i]; | ||
if ((attr.value !== '' && attr.quote !== '"') || | ||
(attr.value === '' && attr.quote === "'")) { | ||
reportMessageCallback("The value of attribute [ " + attr.name + " ] must be in double quotes.", event.line, col + attr.index, _this, attr.raw); | ||
reporter.error(`The value of attribute [ ${attr.name} ] must be in double quotes.`, event.line, col + attr.index, this, attr.raw); | ||
} | ||
@@ -23,2 +22,2 @@ } | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXR0ci12YWx1ZS1kb3VibGUtcXVvdGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvcmUvcnVsZXMvYXR0ci12YWx1ZS1kb3VibGUtcXVvdGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBRUEsa0JBQWU7SU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JLDhCQUE4QixFQUNuRSxLQUFLLENBQUMsSUFBSSxFQUNWLEdBQUcsR0FBRyxJQUFJLENBQUMsS0FBSyxFQUNoQixJQUFJLEVBQ0osSUFBSSxDQUFDLEdBQUcsQ0FDVCxDQUFBO2lCQUNGO2FBQ0Y7UUFDSCxDQUFDLENBQUMsQ0FBQTtJQUNKLENBQUM7Q0FDTSxDQUFBIn0= |
@@ -6,12 +6,11 @@ "use strict"; | ||
description: 'All attributes must have values.', | ||
init: function (parser, reportMessageCallback) { | ||
var _this = this; | ||
parser.addListener('tagstart', function (event) { | ||
var attrs = event.attrs; | ||
var attr; | ||
var col = event.col + event.tagName.length + 1; | ||
for (var i = 0, l = attrs.length; i < l; i++) { | ||
init(parser, reporter) { | ||
parser.addListener('tagstart', (event) => { | ||
const attrs = event.attrs; | ||
let attr; | ||
const col = event.col + event.tagName.length + 1; | ||
for (let i = 0, l = attrs.length; i < l; i++) { | ||
attr = attrs[i]; | ||
if (attr.quote === '' && attr.value === '') { | ||
reportMessageCallback("The attribute [ " + attr.name + " ] must have a value.", event.line, col + attr.index, _this, attr.raw); | ||
reporter.warn(`The attribute [ ${attr.name} ] must have a value.`, event.line, col + attr.index, this, attr.raw); | ||
} | ||
@@ -22,2 +21,2 @@ } | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXR0ci12YWx1ZS1ub3QtZW1wdHkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY29yZS9ydWxlcy9hdHRyLXZhbHVlLW5vdC1lbXB0eS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBLGtCQUFlO0lBQ2IsRUFBRSxFQUFFLHNCQUFzQjtJQUMxQixXQUFXLEVBQUUsa0NBQWtDO0lBQy9DLElBQUksWUFBQyxNQUFNLEVBQUUscUJBQXFCO1FBQWxDLGlCQW9CQztRQW5CQyxNQUFNLENBQUMsV0F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UFXLEVBQUUsa0NBQWtDO0lBQy9DLElBQUksQ0FBQyxNQUFNLEVBQUUsUUFBUTtRQUNuQixNQUFNLENBQUMsV0FBVyxDQUFDLFVBQVUsRUFBRSxDQUFDLEtBQUssRUFBRSxFQUFFO1lBQ3ZDLE1BQU0sS0FBSyxHQUFHLEtBQUssQ0FBQyxLQUFLLENBQUE7WUFDekIsSUFBSSxJQUFJLENBQUE7WUFDUixNQUFNLEdBQUcsR0FBRyxLQUFLLENBQUMsR0FBRyxHQUFHLEtBQUssQ0FBQyxPQUFPLENBQUMsTUFBTSxHQUFHLENBQUMsQ0FBQTtZQUVoRCxLQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsS0FBSyxDQUFDLE1BQU0sRUFBRSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsRUFBRSxFQUFFO2dCQUM1QyxJQUFJLEdBQUcsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFBO2dCQUVmLElBQUksSUFBSSxDQUFDLEtBQUssS0FBSyxFQUFFLElBQUksSUFBSSxDQUFDLEtBQUssS0FBSyxFQUFFLEVBQUU7b0JBQzFDLFFBQVEsQ0FBQyxJQUFJLENBQ1gsbUJBQW1CLElBQUksQ0FBQyxJQUFJLHVCQUF1QixFQUNuRCxLQUFLLENBQUMsSUFBSSxFQUNWLEdBQUcsR0FBRyxJQUFJLENBQUMsS0FBSyxFQUNoQixJQUFJLEVBQ0osSUFBSSxDQUFDLEdBQUcsQ0FDVCxDQUFBO2lCQUNGO2FBQ0Y7UUFDSCxDQUFDLENBQUMsQ0FBQTtJQUNKLENBQUM7Q0FDTSxDQUFBIn0= |
@@ -6,13 +6,12 @@ "use strict"; | ||
description: 'Attribute values must be in single quotes.', | ||
init: function (parser, reportMessageCallback) { | ||
var _this = this; | ||
parser.addListener('tagstart', function (event) { | ||
var attrs = event.attrs; | ||
var attr; | ||
var col = event.col + event.tagName.length + 1; | ||
for (var i = 0, l = attrs.length; i < l; i++) { | ||
init(parser, reporter) { | ||
parser.addListener('tagstart', (event) => { | ||
const attrs = event.attrs; | ||
let attr; | ||
const col = event.col + event.tagName.length + 1; | ||
for (let i = 0, l = attrs.length; i < l; i++) { | ||
attr = attrs[i]; | ||
if ((attr.value !== '' && attr.quote !== "'") || | ||
(attr.value === '' && attr.quote === '"')) { | ||
reportMessageCallback("The value of attribute [ " + attr.name + " ] must be in single quotes.", event.line, col + attr.index, _this, attr.raw); | ||
reporter.error(`The value of attribute [ ${attr.name} ] must be in single quotes.`, event.line, col + attr.index, this, attr.raw); | ||
} | ||
@@ -23,2 +22,2 @@ } | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXR0ci12YWx1ZS1zaW5nbGUtcXVvdGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvcmUvcnVsZXMvYXR0ci12YWx1ZS1zaW5nbGUtcXVvdGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBRUEsa0JBQWU7SUFDYixFQUFFLEVBQUUsMEJBQTBCO0lBQzlCLFdBQVcsRUFBRSw0Q0FBNEM7SUFDekQsSUFBSSxZQUFDLE1BQU0sRUFBRSxxQkFBcUI7UUFBbEMsaUJBdUJDO1FBdEJDLE1BQU0sQ0FBQyxXQUFXLENBQUMsVUFBVSxFQUFFLFVBQUMsS0FBSztZQUNuQyxJQUFNLEtBQUssR0FBRyxLQUFLLENBQUMsS0FBSyxDQUFBO1lBQ3pCLElBQUksSUFBSSxDQUFBO1lBQ1IsSUFBTSxHQUFHLEdBQUcsS0FBSyxDQUFDLEdBQUcsR0FBRyxLQUFLLENBQUMsT0FBTyxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUE7WUFFaEQsS0FBSyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxHQUFHLEtBQUssQ0FBQyxNQUFNLEV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tZQUN6QixJQUFJLElBQUksQ0FBQTtZQUNSLE1BQU0sR0FBRyxHQUFHLEtBQUssQ0FBQyxHQUFHLEdBQUcsS0FBSyxDQUFDLE9BQU8sQ0FBQyxNQUFNLEdBQUcsQ0FBQyxDQUFBO1lBRWhELEtBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxLQUFLLENBQUMsTUFBTSxFQUFFLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxFQUFFLEVBQUU7Z0JBQzVDLElBQUksR0FBRyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUE7Z0JBRWYsSUFDRSxDQUFDLElBQUksQ0FBQyxLQUFLLEtBQUssRUFBRSxJQUFJLElBQUksQ0FBQyxLQUFLLEtBQUssR0FBRyxDQUFDO29CQUN6QyxDQUFDLElBQUksQ0FBQyxLQUFLLEtBQUssRUFBRSxJQUFJLElBQUksQ0FBQyxLQUFLLEtBQUssR0FBRyxDQUFDLEVBQ3pDO29CQUNBLFFBQVEsQ0FBQyxLQUFLLENBQ1osNEJBQTRCLElBQUksQ0FBQyxJQUFJLDhCQUE4QixFQUNuRSxLQUFLLENBQUMsSUFBSSxFQUNWLEdBQUcsR0FBRyxJQUFJLENBQUMsS0FBSyxFQUNoQixJQUFJLEVBQ0osSUFBSSxDQUFDLEdBQUcsQ0FDVCxDQUFBO2lCQUNGO2FBQ0Y7UUFDSCxDQUFDLENBQUMsQ0FBQTtJQUNKLENBQUM7Q0FDTSxDQUFBIn0= |
@@ -6,13 +6,13 @@ "use strict"; | ||
description: 'All attributes should be separated by only one space and not have leading/trailing whitespace.', | ||
init: function (parser, reportMessageCallback, options) { | ||
var _this = this; | ||
var _a; | ||
var exceptions = (_a = options === null || options === void 0 ? void 0 : options.exceptions) !== null && _a !== void 0 ? _a : []; | ||
parser.addListener('tagstart', function (event) { | ||
var attrs = event.attrs; | ||
var attr; | ||
var col = event.col + event.tagName.length + 1; | ||
attrs.forEach(function (elem) { | ||
init(parser, reporter, options) { | ||
const exceptions = Array.isArray(options) | ||
? options | ||
: []; | ||
parser.addListener('tagstart', (event) => { | ||
const attrs = event.attrs; | ||
let attr; | ||
const col = event.col + event.tagName.length + 1; | ||
attrs.forEach((elem) => { | ||
attr = elem; | ||
var attrName = elem.name; | ||
const attrName = elem.name; | ||
if (exceptions.indexOf(attrName) !== -1) { | ||
@@ -22,6 +22,6 @@ return; | ||
if (elem.value.trim() !== elem.value) { | ||
reportMessageCallback("The attributes of [ " + attrName + " ] must not have trailing whitespace.", event.line, col + attr.index, _this, attr.raw); | ||
reporter.error(`The attributes of [ ${attrName} ] must not have trailing whitespace.`, event.line, col + attr.index, this, attr.raw); | ||
} | ||
if (elem.value.replace(/ +(?= )/g, '') !== elem.value) { | ||
reportMessageCallback("The attributes of [ " + attrName + " ] must be separated by only one space.", event.line, col + attr.index, _this, attr.raw); | ||
reporter.error(`The attributes of [ ${attrName} ] must be separated by only one space.`, event.line, col + attr.index, this, attr.raw); | ||
} | ||
@@ -32,2 +32,2 @@ }); | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXR0ci13aGl0ZXNwYWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvcmUvcnVsZXMvYXR0ci13aGl0ZXNwYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBRUEsa0JBQWU7SUFDYixFQUFFLEVBQUUsaUJBQWlCO0lBQ3JCLFdBQVcsRUFDVCxnR0FBZ0c7SUFDbEcsSUFBSSxFQUFKLFVBQUssTUFBTSxFQUFFLHFCQUFxQixFQUFFLE9BQWtDO1FBQXRFLGlCQXNDQzs7UUFyQ0MsSUFBTSxVQUFVLFNBQWEsT0FBTyxhQUFQLE9BQU8sdUJBQVAsT0FBTyxDQUFFLFVBQVUsbUNBQUksRUFBRSxDQUFBO1FBRXRELE1BQU0sQ0FB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BQUMsRUFBRTtvQkFDdkMsT0FBTTtpQkFDUDtnQkFHRCxJQUFJLElBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxFQUFFLEtBQUssSUFBSSxDQUFDLEtBQUssRUFBRTtvQkFDcEMsUUFBUSxDQUFDLEtBQUssQ0FDWix1QkFBdUIsUUFBUSx1Q0FBdUMsRUFDdEUsS0FBSyxDQUFDLElBQUksRUFDVixHQUFHLEdBQUcsSUFBSSxDQUFDLEtBQUssRUFDaEIsSUFBSSxFQUNKLElBQUksQ0FBQyxHQUFHLENBQ1QsQ0FBQTtpQkFDRjtnQkFFRCxJQUFJLElBQUksQ0FBQyxLQUFLLENBQUMsT0FBTyxDQUFDLFVBQVUsRUFBRSxFQUFFLENBQUMsS0FBSyxJQUFJLENBQUMsS0FBSyxFQUFFO29CQUNyRCxRQUFRLENBQUMsS0FBSyxDQUNaLHVCQUF1QixRQUFRLHlDQUF5QyxFQUN4RSxLQUFLLENBQUMsSUFBSSxFQUNWLEdBQUcsR0FBRyxJQUFJLENBQUMsS0FBSyxFQUNoQixJQUFJLEVBQ0osSUFBSSxDQUFDLEdBQUcsQ0FDVCxDQUFBO2lCQUNGO1lBQ0gsQ0FBQyxDQUFDLENBQUE7UUFDSixDQUFDLENBQUMsQ0FBQTtJQUNKLENBQUM7Q0FDTSxDQUFBIn0= |
@@ -6,5 +6,4 @@ "use strict"; | ||
description: 'Doctype must be declared first.', | ||
init: function (parser, reportMessageCallback) { | ||
var _this = this; | ||
var allEvent = function (event) { | ||
init(parser, reporter) { | ||
const allEvent = (event) => { | ||
if (event.type === 'start' || | ||
@@ -16,3 +15,3 @@ (event.type === 'text' && /^\s*$/.test(event.raw))) { | ||
/^DOCTYPE\s+/i.test(event.content) === false) { | ||
reportMessageCallback('Doctype must be declared first.', event.line, event.col, _this, event.raw); | ||
reporter.error('Doctype must be declared first.', event.line, event.col, this, event.raw); | ||
} | ||
@@ -24,2 +23,2 @@ parser.removeListener('all', allEvent); | ||
}; | ||
//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N4QyxDQUFDLENBQUE7UUFFRCxNQUFNLENBQUMsV0FBVyxDQUFDLEtBQUssRUFBRSxRQUFRLENBQUMsQ0FBQTtJQUNyQyxDQUFDO0NBQ00sQ0FBQSJ9 |
@@ -6,11 +6,10 @@ "use strict"; | ||
description: 'Invalid doctype. Use: "<!DOCTYPE html>"', | ||
init: function (parser, reportMessageCallback) { | ||
var _this = this; | ||
var onComment = function (event) { | ||
init(parser, reporter) { | ||
const onComment = (event) => { | ||
if (event.long === false && | ||
event.content.toLowerCase() !== 'doctype html') { | ||
reportMessageCallback('Invalid doctype. Use: "<!DOCTYPE html>"', event.line, event.col, _this, event.raw); | ||
reporter.warn('Invalid doctype. Use: "<!DOCTYPE html>"', event.line, event.col, this, event.raw); | ||
} | ||
}; | ||
var onTagStart = function () { | ||
const onTagStart = () => { | ||
parser.removeListener('comment', onComment); | ||
@@ -23,2 +22,2 @@ parser.removeListener('tagstart', onTagStart); | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZG9jdHlwZS1odG1sNS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb3JlL3J1bGVzL2RvY3R5cGUtaHRtbDUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFHQSxrQkFBZTtJQUNiLEVBQUUsRUFBRSxlQUFlO0lBQ25CLFdBQVcsRUFBRSx5Q0FBeUM7SUFDdEQsSUFBSSxFQUFKLFVBQUssTUFBTSxFQUFFLHFCQUFxQjtRQUFsQyxpQkF1QkM7UUF0QkMsSUFBTSxTQUFTLEdBQWEsVUFBQyxLQUFLO1lBQ2hDLElBQ0UsS0FBSyxDQUFDLElBQUksS0FBSyxLQUFLO2dCQUNwQixLQUFLLENBQUMsT0FBTyxDQUFDLFdBQVcsRUFBRSxLQUFLLGNBQWMsRUFDOUM7Z0JBQ0EscUJBQXFCLENBQ25CLHlDQUF5QyxFQ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FLLENBQUMsSUFBSSxFQUNWLEtBQUssQ0FBQyxHQUFHLEVBQ1QsSUFBSSxFQUNKLEtBQUssQ0FBQyxHQUFHLENBQ1YsQ0FBQTthQUNGO1FBQ0gsQ0FBQyxDQUFBO1FBRUQsTUFBTSxVQUFVLEdBQWEsR0FBRyxFQUFFO1lBQ2hDLE1BQU0sQ0FBQyxjQUFjLENBQUMsU0FBUyxFQUFFLFNBQVMsQ0FBQyxDQUFBO1lBQzNDLE1BQU0sQ0FBQyxjQUFjLENBQUMsVUFBVSxFQUFFLFVBQVUsQ0FBQyxDQUFBO1FBQy9DLENBQUMsQ0FBQTtRQUVELE1BQU0sQ0FBQyxXQUFXLENBQUMsS0FBSyxFQUFFLFNBQVMsQ0FBQyxDQUFBO1FBQ3BDLE1BQU0sQ0FBQyxXQUFXLENBQUMsVUFBVSxFQUFFLFVBQVUsQ0FBQyxDQUFBO0lBQzVDLENBQUM7Q0FDTSxDQUFBIn0= |
@@ -6,10 +6,9 @@ "use strict"; | ||
description: 'The <script> tag cannot be used in a <head> tag.', | ||
init: function (parser, reportMessageCallback) { | ||
var _this = this; | ||
var reScript = /^(text\/javascript|application\/javascript)$/i; | ||
var isInHead = false; | ||
var onTagStart = function (event) { | ||
var mapAttrs = parser.getMapAttrs(event.attrs); | ||
var type = mapAttrs.type; | ||
var tagName = event.tagName.toLowerCase(); | ||
init(parser, reporter) { | ||
const reScript = /^(text\/javascript|application\/javascript)$/i; | ||
let isInHead = false; | ||
const onTagStart = (event) => { | ||
const mapAttrs = parser.getMapAttrs(event.attrs); | ||
const type = mapAttrs.type; | ||
const tagName = event.tagName.toLowerCase(); | ||
if (tagName === 'head') { | ||
@@ -21,6 +20,6 @@ isInHead = true; | ||
(!type || reScript.test(type) === true)) { | ||
reportMessageCallback('The <script> tag cannot be used in a <head> tag.', event.line, event.col, _this, event.raw); | ||
reporter.warn('The <script> tag cannot be used in a <head> tag.', event.line, event.col, this, event.raw); | ||
} | ||
}; | ||
var onTagEnd = function (event) { | ||
const onTagEnd = (event) => { | ||
if (event.tagName.toLowerCase() === 'head') { | ||
@@ -35,2 +34,2 @@ parser.removeListener('tagstart', onTagStart); | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGVhZC1zY3JpcHQtZGlzYWJsZWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY29yZS9ydWxlcy9oZWFkLXNjcmlwdC1kaXNhYmxlZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUdBLGtCQUFlO0lBQ2IsRUFBRSxFQUFFLHNCQUFzQjtJQUMxQixXQUFXLEVBQUUsa0RBQWtEO0lBQy9ELElBQUksRUFBSixVQUFLLE1BQU0sRUFBRSxxQkFBcUI7UUFBbEMsaUJBcUNDO1FBcENDLElBQU0sUUFBUSxHQUFHLCtDQUErQyxDQUFBO1FBQ2hFLElBQUksUUFBUSxHQUFHLEtBQUssQ0FBQTtRQUVwQixJQUFNLFVBQVUsR0FBYSxVQUFDLEtBQUs7WUFDakMsSUFBTSxRQUFRLEdBQUcsTUFBTSxDQUFDLFdBQVcsQ0FBQyxLQUFLLENBQUMsS0FBSyxDQUFDLENBQUE7WUFDaEQsSUFBTSxJQUFJLEdBQUcsUUFBUSxDQUFDLElBQUksQ0FBQTtZQUMxQixJQUFNLE9BQU8sR0FBRyxLQUFLLENBQUMsT0FBTyxDQUFDLFdBQVcsRUFBRSxDQUFBO1lBRTNDLElBQUksT0FBTyxLQUFLLE1BQU0sRUFBRTtnQkFDdEIsUUFBUSxHQUFHLElBQUksQ0FBQTthQUNoQjtZQUVELElBQ0UsUUFBUSxLQUFLLElBQUk7Z0JBQ2pCLE9BQU8sS0FBSyxRQUFRO2dCQUNwQixDQUFDLENBQUMsSUFBSSxJQUFJLFFBQVEsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLEtBQUssSUFBSSxDQUFDLEVBQ3ZD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QUE7UUFDMUMsTUFBTSxDQUFDLFdBQVcsQ0FBQyxRQUFRLEVBQUUsUUFBUSxDQUFDLENBQUE7SUFDeEMsQ0FBQztDQUNNLENBQUEifQ== |
@@ -6,11 +6,9 @@ "use strict"; | ||
description: 'An href attribute must be either absolute or relative.', | ||
init: function (parser, reportMessageCallback, options) { | ||
var _this = this; | ||
var _a; | ||
var hrefMode = (_a = options === null || options === void 0 ? void 0 : options.mode) !== null && _a !== void 0 ? _a : 'absolute'; | ||
parser.addListener('tagstart', function (event) { | ||
var attrs = event.attrs; | ||
var attr; | ||
var col = event.col + event.tagName.length + 1; | ||
for (var i = 0, l = attrs.length; i < l; i++) { | ||
init(parser, reporter, options) { | ||
const hrefMode = options === 'abs' ? 'absolute' : 'relative'; | ||
parser.addListener('tagstart', (event) => { | ||
const attrs = event.attrs; | ||
let attr; | ||
const col = event.col + event.tagName.length + 1; | ||
for (let i = 0, l = attrs.length; i < l; i++) { | ||
attr = attrs[i]; | ||
@@ -21,3 +19,3 @@ if (attr.name === 'href') { | ||
/^https?:\/\//.test(attr.value) === true)) { | ||
reportMessageCallback("The value of the href attribute [ " + attr.value + " ] must be " + hrefMode + ".", event.line, col + attr.index, _this, attr.raw); | ||
reporter.warn(`The value of the href attribute [ ${attr.value} ] must be ${hrefMode}.`, event.line, col + attr.index, this, attr.raw); | ||
} | ||
@@ -30,2 +28,2 @@ break; | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHJlZi1hYnMtb3ItcmVsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvcmUvcnVsZXMvaHJlZi1hYnMtb3ItcmVsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBRUEsa0JBQWU7SUFDYixFQUFFLEVBQUUsaUJBQWlCO0lBQ3JCLFdBQVcsRUFBRSx3REFBd0Q7SUFDckUsSUFBSSxFQUFKLF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sQ0FBQyxDQUFBO2dCQUVmLElBQUksSUFBSSxDQUFDLElBQUksS0FBSyxNQUFNLEVBQUU7b0JBQ3hCLElBQ0UsQ0FBQyxRQUFRLEtBQUssVUFBVSxJQUFJLFFBQVEsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxLQUFLLEtBQUssQ0FBQzt3QkFDaEUsQ0FBQyxRQUFRLEtBQUssVUFBVTs0QkFDdEIsY0FBYyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLEtBQUssSUFBSSxDQUFDLEVBQzNDO3dCQUNBLFFBQVEsQ0FBQyxJQUFJLENBQ1gscUNBQXFDLElBQUksQ0FBQyxLQUFLLGNBQWMsUUFBUSxHQUFHLEVBQ3hFLEtBQUssQ0FBQyxJQUFJLEVBQ1YsR0FBRyxHQUFHLElBQUksQ0FBQyxLQUFLLEVBQ2hCLElBQUksRUFDSixJQUFJLENBQUMsR0FBRyxDQUNULENBQUE7cUJBQ0Y7b0JBQ0QsTUFBSztpQkFDTjthQUNGO1FBQ0gsQ0FBQyxDQUFDLENBQUE7SUFDSixDQUFDO0NBQ00sQ0FBQSJ9 |
@@ -6,10 +6,9 @@ "use strict"; | ||
description: 'The id and class attributes cannot use the ad keyword, it will be blocked by adblock software.', | ||
init: function (parser, reportMessageCallback) { | ||
var _this = this; | ||
parser.addListener('tagstart', function (event) { | ||
var attrs = event.attrs; | ||
var attr; | ||
var attrName; | ||
var col = event.col + event.tagName.length + 1; | ||
for (var i = 0, l = attrs.length; i < l; i++) { | ||
init(parser, reporter) { | ||
parser.addListener('tagstart', (event) => { | ||
const attrs = event.attrs; | ||
let attr; | ||
let attrName; | ||
const col = event.col + event.tagName.length + 1; | ||
for (let i = 0, l = attrs.length; i < l; i++) { | ||
attr = attrs[i]; | ||
@@ -19,3 +18,3 @@ attrName = attr.name; | ||
if (/(^|[-_])ad([-_]|$)/i.test(attr.value)) { | ||
reportMessageCallback("The value of attribute " + attrName + " cannot use the ad keyword.", event.line, col + attr.index, _this, attr.raw); | ||
reporter.warn(`The value of attribute ${attrName} cannot use the ad keyword.`, event.line, col + attr.index, this, attr.raw); | ||
} | ||
@@ -27,2 +26,2 @@ } | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWQtY2xhc3MtYWQtZGlzYWJsZWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY29yZS9ydWxlcy9pZC1jbGFzcy1hZC1kaXNhYmxlZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBLGtCQUFlO0lBQ2IsRUFBRSxFQUFFLHNCQUFzQjtJQUMxQixXQUFXLEVBQ1QsZ0dBQWdHO0lBQ2xHLElBQUksWUFBQyxNQUFNLEVBQUUscUJBQXFCO1FBQWxDLGlCQXdCQztRQXZCQyxNQUFNLENBQUMsV0FBVyxDQUFDLFVBQVUsRUFBRSxVQUFDLEtBQUs7WUFDbkMsSUFBTSxLQUFLLEdBQUcsS0FBSyxDQUFDLEtBQUssQ0FBQTtZQUN6QixJQUFJLElBQUksQ0FBQTtZQUNSLElBQUksUUFBUSxDQUFBO1lBQ1osSUFBTSxHQUFHLEdBQUcsS0FBSyxDQUFDLEdBQUcsR0FBRyxLQUFLLENBQUMsT0FBTyxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUE7WUFFaEQsS0FBSyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxHQUFHLEtBQUssQ0FBQyxNQUFNLEVBQUUsQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEVBQUUsRUFBRTtnQkFDNUMsSUFBSSxHQUFHLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQTtnQkFDZixRQUFRLEdBQUcsSUFBSSxDQUFDLElBQUksQ0FBQTtnQkFFcEIsSUFBSSxlQUFlLENBQUMsSUFBSSxDQUFDLFF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LQUFLLENBQUMsTUFBTSxFQUFFLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxFQUFFLEVBQUU7Z0JBQzVDLElBQUksR0FBRyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUE7Z0JBQ2YsUUFBUSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUE7Z0JBRXBCLElBQUksZUFBZSxDQUFDLElBQUksQ0FBQyxRQUFRLENBQUMsRUFBRTtvQkFDbEMsSUFBSSxxQkFBcUIsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxFQUFFO3dCQUMxQyxRQUFRLENBQUMsSUFBSSxDQUNYLDBCQUEwQixRQUFRLDZCQUE2QixFQUMvRCxLQUFLLENBQUMsSUFBSSxFQUNWLEdBQUcsR0FBRyxJQUFJLENBQUMsS0FBSyxFQUNoQixJQUFJLEVBQ0osSUFBSSxDQUFDLEdBQUcsQ0FDVCxDQUFBO3FCQUNGO2lCQUNGO2FBQ0Y7UUFDSCxDQUFDLENBQUMsQ0FBQTtJQUNKLENBQUM7Q0FDTSxDQUFBIn0= |
@@ -6,5 +6,4 @@ "use strict"; | ||
description: 'The id and class attribute values must meet the specified rules.', | ||
init: function (parser, reportMessageCallback, options) { | ||
var _this = this; | ||
var arrRules = { | ||
init(parser, reporter, options) { | ||
const arrRules = { | ||
underline: { | ||
@@ -23,35 +22,33 @@ regId: /^[a-z\d]+(_[a-z\d]+)*$/, | ||
}; | ||
var rule = arrRules.dash; | ||
if (typeof options === 'object') { | ||
if ('mode' in options) { | ||
rule = arrRules[options.mode]; | ||
} | ||
else { | ||
rule = options; | ||
} | ||
let rule; | ||
if (typeof options === 'string') { | ||
rule = arrRules[options]; | ||
} | ||
else { | ||
rule = options; | ||
} | ||
if (typeof rule === 'object' && rule.regId) { | ||
var regId_1 = rule.regId; | ||
var message_1 = rule.message; | ||
if (!(regId_1 instanceof RegExp)) { | ||
regId_1 = new RegExp(regId_1); | ||
let regId = rule.regId; | ||
const message = rule.message; | ||
if (!(regId instanceof RegExp)) { | ||
regId = new RegExp(regId); | ||
} | ||
parser.addListener('tagstart', function (event) { | ||
var attrs = event.attrs; | ||
var attr; | ||
var col = event.col + event.tagName.length + 1; | ||
for (var i = 0, l1 = attrs.length; i < l1; i++) { | ||
parser.addListener('tagstart', (event) => { | ||
const attrs = event.attrs; | ||
let attr; | ||
const col = event.col + event.tagName.length + 1; | ||
for (let i = 0, l1 = attrs.length; i < l1; i++) { | ||
attr = attrs[i]; | ||
if (attr.name.toLowerCase() === 'id') { | ||
if (regId_1.test(attr.value) === false) { | ||
reportMessageCallback(message_1, event.line, col + attr.index, _this, attr.raw); | ||
if (regId.test(attr.value) === false) { | ||
reporter.warn(message, event.line, col + attr.index, this, attr.raw); | ||
} | ||
} | ||
if (attr.name.toLowerCase() === 'class') { | ||
var arrClass = attr.value.split(/\s+/g); | ||
var classValue = void 0; | ||
for (var j = 0, l2 = arrClass.length; j < l2; j++) { | ||
const arrClass = attr.value.split(/\s+/g); | ||
let classValue; | ||
for (let j = 0, l2 = arrClass.length; j < l2; j++) { | ||
classValue = arrClass[j]; | ||
if (classValue && regId_1.test(classValue) === false) { | ||
reportMessageCallback(message_1, event.line, col + attr.index, _this, classValue); | ||
if (classValue && regId.test(classValue) === false) { | ||
reporter.warn(message, event.line, col + attr.index, this, classValue); | ||
} | ||
@@ -65,2 +62,2 @@ } | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWQtY2xhc3MtdmFsdWUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY29yZS9ydWxlcy9pZC1jbGFzcy12YWx1ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBLGtCQUFlO0lBQ2IsRUFBRSxFQUFFLGdCQUFnQjtJQUNwQixXQUFXLEVBQ1Qsa0VBQWtFO0lBQ3BFLElBQUksRUFBSixVQUNF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back) { | ||
var _this = this; | ||
var mapIdCount = {}; | ||
parser.addListener('tagstart', function (event) { | ||
var attrs = event.attrs; | ||
var attr; | ||
var id; | ||
var col = event.col + event.tagName.length + 1; | ||
for (var i = 0, l = attrs.length; i < l; i++) { | ||
init(parser, reporter) { | ||
const mapIdCount = {}; | ||
parser.addListener('tagstart', (event) => { | ||
const attrs = event.attrs; | ||
let attr; | ||
let id; | ||
const col = event.col + event.tagName.length + 1; | ||
for (let i = 0, l = attrs.length; i < l; i++) { | ||
attr = attrs[i]; | ||
@@ -27,3 +26,3 @@ if (attr.name.toLowerCase() === 'id') { | ||
if (mapIdCount[id] > 1) { | ||
reportMessageCallback("The id value [ " + id + " ] must be unique.", event.line, col + attr.index, _this, attr.raw); | ||
reporter.error(`The id value [ ${id} ] must be unique.`, event.line, col + attr.index, this, attr.raw); | ||
} | ||
@@ -37,2 +36,2 @@ } | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWQtdW5pcXVlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvcmUvcnVsZXMvaWQtdW5pcXVlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBRUEsa0JBQWU7SUFDYixFQUFFLEVBQUUsV0FBVztJQUNmLFdBQVcsRUFBRSw0Q0FBNEM7SUFDekQsSUFBSSxFQUFKLFVBQUssTUFBTSxFQUFFLHFCQUFxQjtRQUFsQyxpQkFvQ0M7UUFuQ0MsSUFBTSxVQUFVLEdBQTZCLEVBQUUsQ0FBQTtRQUUvQyxNQUFNLENBQUMsV0FBVyxDQUFDLFVBQVUsRUFBRSxVQUFDLEtBQUs7WUFDbkMsSUFBTSxLQUFLLEdBQUcsS0FBSyxDQUFDLEtBQUssQ0FBQTtZQUN6QixJQUFJLElBQUksQ0FBQTtZQUNSLElBQUksRUFBRSxDQUFBO1lBQ04sSUFBTSxHQUFHLEdBQ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FBVSxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUE7eUJBQ2pCO3dCQUVELElBQUksVUFBVSxDQUFDLEVBQUUsQ0FBQyxHQUFHLENBQUMsRUFBRTs0QkFDdEIsUUFBUSxDQUFDLEtBQUssQ0FDWixrQkFBa0IsRUFBRSxvQkFBb0IsRUFDeEMsS0FBSyxDQUFDLElBQUksRUFDVixHQUFHLEdBQUcsSUFBSSxDQUFDLEtBQUssRUFDaEIsSUFBSSxFQUNKLElBQUksQ0FBQyxHQUFHLENBQ1QsQ0FBQTt5QkFDRjtxQkFDRjtvQkFDRCxNQUFLO2lCQUNOO2FBQ0Y7UUFDSCxDQUFDLENBQUMsQ0FBQTtJQUNKLENBQUM7Q0FDTSxDQUFBIn0= |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.attrNoUnnecessaryWhitespace = exports.tagsCheck = exports.titleRequire = exports.tagnameSpecialChars = exports.tagnameLowercase = exports.emptyTagNotSelfClosed = exports.tagSelfClose = exports.tagPair = exports.styleDisabled = exports.srcNotEmpty = exports.specCharEscape = exports.spaceTabMixedDisabled = exports.scriptDisabled = exports.inputRequiresLabel = exports.inlineStyleDisabled = exports.inlineScriptDisabled = exports.idUnique = exports.idClassValue = exports.idClsasAdDisabled = exports.htmlLangRequire = exports.hrefAbsOrRel = exports.headScriptDisabled = exports.doctypeHTML5 = exports.doctypeFirst = exports.attrWhitespace = exports.attrValueSingleQuotes = exports.attrValueNotEmpty = exports.attrValueDoubleQuotes = exports.attrUnsafeChars = exports.attrNoDuplication = exports.attrSort = exports.attrLowercase = exports.altRequire = void 0; | ||
var alt_require_1 = require("./alt-require"); | ||
@@ -29,2 +30,4 @@ Object.defineProperty(exports, "altRequire", { enumerable: true, get: function () { return alt_require_1.default; } }); | ||
Object.defineProperty(exports, "hrefAbsOrRel", { enumerable: true, get: function () { return href_abs_or_rel_1.default; } }); | ||
var html_lang_require_1 = require("./html-lang-require"); | ||
Object.defineProperty(exports, "htmlLangRequire", { enumerable: true, get: function () { return html_lang_require_1.default; } }); | ||
var id_class_ad_disabled_1 = require("./id-class-ad-disabled"); | ||
@@ -56,2 +59,4 @@ Object.defineProperty(exports, "idClsasAdDisabled", { enumerable: true, get: function () { return id_class_ad_disabled_1.default; } }); | ||
Object.defineProperty(exports, "tagSelfClose", { enumerable: true, get: function () { return tag_self_close_1.default; } }); | ||
var empty_tag_not_self_closed_1 = require("./empty-tag-not-self-closed"); | ||
Object.defineProperty(exports, "emptyTagNotSelfClosed", { enumerable: true, get: function () { return empty_tag_not_self_closed_1.default; } }); | ||
var tagname_lowercase_1 = require("./tagname-lowercase"); | ||
@@ -67,2 +72,2 @@ Object.defineProperty(exports, "tagnameLowercase", { enumerable: true, get: function () { return tagname_lowercase_1.default; } }); | ||
Object.defineProperty(exports, "attrNoUnnecessaryWhitespace", { enumerable: true, get: function () { return attr_no_unnecessary_whitespace_1.default; } }); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY29yZS9ydWxlcy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDZDQUFxRDtBQUE1Qyx5R0FBQSxPQUFPLE9BQWM7QUFDOUIsbURBQTJEO0FBQWxELCtHQUFBLE9BQU8sT0FBaUI7QUFDakMsNkNBQW1EO0FBQTFDLHVHQUFBLE9BQU8sT0FBWTtBQUM1Qiw2REFBb0U7QUFBM0Qsd0hBQUEsT0FBTyxPQUFxQjtBQUNyQyx5REFBZ0U7QUFBdkQsb0hBQUEsT0FBTyxPQUFtQjtBQUNuQyx1RUFBNkU7QUFBcEUsaUlBQUEsT0FBTyxPQUF5QjtBQUN6QywrREFBcUU7QUFBNUQseUhBQUEsT0FBTyxPQUFxQjtBQUNyQyx1RUFBNkU7QUFBcEUsaUlBQUEsT0FBTyxPQUF5QjtBQ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BWTtBQUM1QixtRUFBMEU7QUFBakUsOEhBQUEsT0FBTyxPQUF3QjtBQUN4QyxpRUFBd0U7QUFBL0QsNEhBQUEsT0FBTyxPQUF1QjtBQUN2QywrREFBc0U7QUFBN0QsMEhBQUEsT0FBTyxPQUFzQjtBQUN0QyxxREFBNkQ7QUFBcEQsaUhBQUEsT0FBTyxPQUFrQjtBQUNsQyx1RUFBNkU7QUFBcEUsaUlBQUEsT0FBTyxPQUF5QjtBQUN6Qyx1REFBOEQ7QUFBckQsa0hBQUEsT0FBTyxPQUFrQjtBQUNsQyxpREFBd0Q7QUFBL0MsNEdBQUEsT0FBTyxPQUFlO0FBQy9CLG1EQUEyRDtBQUFsRCwrR0FBQSxPQUFPLE9BQWlCO0FBQ2pDLHVDQUErQztBQUF0QyxtR0FBQSxPQUFPLE9BQVc7QUFDM0IsbURBQTBEO0FBQWpELDhHQUFBLE9BQU8sT0FBZ0I7QUFDaEMseUVBQThFO0FBQXJFLGtJQUFBLE9BQU8sT0FBeUI7QUFDekMseURBQWlFO0FBQXhELHFIQUFBLE9BQU8sT0FBb0I7QUFDcEMsK0RBQXVFO0FBQTlELDJIQUFBLE9BQU8sT0FBdUI7QUFDdkMsaURBQXlEO0FBQWhELDZHQUFBLE9BQU8sT0FBZ0I7QUFDaEMsMkNBQW1EO0FBQTFDLHVHQUFBLE9BQU8sT0FBYTtBQUM3QixtRkFBeUY7QUFBaEYsNklBQUEsT0FBTyxPQUErQiJ9 |
@@ -6,19 +6,18 @@ "use strict"; | ||
description: 'Inline script cannot be used.', | ||
init: function (parser, reportMessageCallback) { | ||
var _this = this; | ||
parser.addListener('tagstart', function (event) { | ||
var attrs = event.attrs; | ||
var attr; | ||
var col = event.col + event.tagName.length + 1; | ||
var attrName; | ||
var reEvent = /^on(unload|message|submit|select|scroll|resize|mouseover|mouseout|mousemove|mouseleave|mouseenter|mousedown|load|keyup|keypress|keydown|focus|dblclick|click|change|blur|error)$/i; | ||
for (var i = 0, l = attrs.length; i < l; i++) { | ||
init(parser, reporter) { | ||
parser.addListener('tagstart', (event) => { | ||
const attrs = event.attrs; | ||
let attr; | ||
const col = event.col + event.tagName.length + 1; | ||
let attrName; | ||
const reEvent = /^on(unload|message|submit|select|scroll|resize|mouseover|mouseout|mousemove|mouseleave|mouseenter|mousedown|load|keyup|keypress|keydown|focus|dblclick|click|change|blur|error)$/i; | ||
for (let i = 0, l = attrs.length; i < l; i++) { | ||
attr = attrs[i]; | ||
attrName = attr.name.toLowerCase(); | ||
if (reEvent.test(attrName) === true) { | ||
reportMessageCallback("Inline script [ " + attr.raw + " ] cannot be used.", event.line, col + attr.index, _this, attr.raw); | ||
reporter.warn(`Inline script [ ${attr.raw} ] cannot be used.`, event.line, col + attr.index, this, attr.raw); | ||
} | ||
else if (attrName === 'src' || attrName === 'href') { | ||
if (/^\s*javascript:/i.test(attr.value)) { | ||
reportMessageCallback("Inline script [ " + attr.raw + " ] cannot be used.", event.line, col + attr.index, _this, attr.raw); | ||
reporter.warn(`Inline script [ ${attr.raw} ] cannot be used.`, event.line, col + attr.index, this, attr.raw); | ||
} | ||
@@ -30,2 +29,2 @@ } | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lLXNjcmlwdC1kaXNhYmxlZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb3JlL3J1bGVzL2lubGluZS1zY3JpcHQtZGlzYWJsZWQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFFQSxrQkFBZTtJQUNiLEVBQUUsRUFBRSx3QkFBd0I7SUFDNUIsV0FBVyxFQUFFLCtCQUErQjtJQUM1QyxJQUFJLFlBQUMsTUFBTSxFQUFFLHFCQUFxQjtRQUFsQyxpQkFpQ0M7UUFoQ0MsTUFBTSxDQUFDLFdBQVcsQ0FBQyxVQUFVLEVBQUUsVUFBQyxLQUFLO1lBQ25DLElBQU0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MsSUFBSSxDQUFDLFdBQVcsRUFBRSxDQUFBO2dCQUVsQyxJQUFJLE9BQU8sQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDLEtBQUssSUFBSSxFQUFFO29CQUNuQyxRQUFRLENBQUMsSUFBSSxDQUNYLG1CQUFtQixJQUFJLENBQUMsR0FBRyxvQkFBb0IsRUFDL0MsS0FBSyxDQUFDLElBQUksRUFDVixHQUFHLEdBQUcsSUFBSSxDQUFDLEtBQUssRUFDaEIsSUFBSSxFQUNKLElBQUksQ0FBQyxHQUFHLENBQ1QsQ0FBQTtpQkFDRjtxQkFBTSxJQUFJLFFBQVEsS0FBSyxLQUFLLElBQUksUUFBUSxLQUFLLE1BQU0sRUFBRTtvQkFDcEQsSUFBSSxrQkFBa0IsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxFQUFFO3dCQUN2QyxRQUFRLENBQUMsSUFBSSxDQUNYLG1CQUFtQixJQUFJLENBQUMsR0FBRyxvQkFBb0IsRUFDL0MsS0FBSyxDQUFDLElBQUksRUFDVixHQUFHLEdBQUcsSUFBSSxDQUFDLEtBQUssRUFDaEIsSUFBSSxFQUNKLElBQUksQ0FBQyxHQUFHLENBQ1QsQ0FBQTtxQkFDRjtpQkFDRjthQUNGO1FBQ0gsQ0FBQyxDQUFDLENBQUE7SUFDSixDQUFDO0NBQ00sQ0FBQSJ9 |
@@ -6,12 +6,11 @@ "use strict"; | ||
description: 'Inline style cannot be used.', | ||
init: function (parser, reportMessageCallback) { | ||
var _this = this; | ||
parser.addListener('tagstart', function (event) { | ||
var attrs = event.attrs; | ||
var attr; | ||
var col = event.col + event.tagName.length + 1; | ||
for (var i = 0, l = attrs.length; i < l; i++) { | ||
init(parser, reporter) { | ||
parser.addListener('tagstart', (event) => { | ||
const attrs = event.attrs; | ||
let attr; | ||
const col = event.col + event.tagName.length + 1; | ||
for (let i = 0, l = attrs.length; i < l; i++) { | ||
attr = attrs[i]; | ||
if (attr.name.toLowerCase() === 'style') { | ||
reportMessageCallback("Inline style [ " + attr.raw + " ] cannot be used.", event.line, col + attr.index, _this, attr.raw); | ||
reporter.warn(`Inline style [ ${attr.raw} ] cannot be used.`, event.line, col + attr.index, this, attr.raw); | ||
} | ||
@@ -22,2 +21,2 @@ } | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lLXN0eWxlLWRpc2FibGVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvcmUvcnVsZXMvaW5saW5lLXN0eWxlLWRpc2FibGVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBRUEsa0JBQWU7SUFDYixFQUFFLEVBQUUsdUJBQXVCO0lBQzNCLFdBQVcsRUFBRSw4QkFBOEI7SUFDM0MsSUFBSSxZQUFDLE1BQU0sRUFBRSxxQkFBcUI7UUFBbEMsaUJBb0JDO1FBbkJDLE1BQU0sQ0FBQyxXQUFXLENBQUMsVUFBVSxFQUFFLFVBQUMsS0FBSztZQUNuQyxJQUFNLEtBQUssR0FBRyxLQUFLLENBQUMsS0FBSyxDQUFBO1lBQ3pCLElBQUksSUFBSSxDQUFBO1lBQ1IsSUFBTSxHQUFHLEdBQUcsS0FBSyxDQUFDLEdBQUcsR0FBRyxLQUFLLENBQUMsT0FBTyxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUE7WUFFaEQsS0FBSyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxHQUFHLEtBQUssQ0FBQyxNQUFNLEVBQUUsQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEVBQUUsRUFBRTtnQkFDNUMsSUFBSSxHQUFHLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQTtnQkFFZixJQUFJLElBQUksQ0FBQyxJQUFJLENBQUMsV0FBVyxFQUFFLEtBQUssT0FBTyxFQUFFO29CQUN2Qyx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BQUE7Z0JBRWYsSUFBSSxJQUFJLENBQUMsSUFBSSxDQUFDLFdBQVcsRUFBRSxLQUFLLE9BQU8sRUFBRTtvQkFDdkMsUUFBUSxDQUFDLElBQUksQ0FDWCxrQkFBa0IsSUFBSSxDQUFDLEdBQUcsb0JBQW9CLEVBQzlDLEtBQUssQ0FBQyxJQUFJLEVBQ1YsR0FBRyxHQUFHLElBQUksQ0FBQyxLQUFLLEVBQ2hCLElBQUksRUFDSixJQUFJLENBQUMsR0FBRyxDQUNULENBQUE7aUJBQ0Y7YUFDRjtRQUNILENBQUMsQ0FBQyxDQUFBO0lBQ0osQ0FBQztDQUNNLENBQUEifQ== |
@@ -6,10 +6,9 @@ "use strict"; | ||
description: 'All [ input ] tags must have a corresponding [ label ] tag. ', | ||
init: function (parser, reportMessageCallback) { | ||
var _this = this; | ||
var labelTags = []; | ||
var inputTags = []; | ||
parser.addListener('tagstart', function (event) { | ||
var tagName = event.tagName.toLowerCase(); | ||
var mapAttrs = parser.getMapAttrs(event.attrs); | ||
var col = event.col + tagName.length + 1; | ||
init(parser, reporter) { | ||
const labelTags = []; | ||
const inputTags = []; | ||
parser.addListener('tagstart', (event) => { | ||
const tagName = event.tagName.toLowerCase(); | ||
const mapAttrs = parser.getMapAttrs(event.attrs); | ||
const col = event.col + tagName.length + 1; | ||
if (tagName === 'input') { | ||
@@ -24,6 +23,6 @@ inputTags.push({ event: event, col: col, id: mapAttrs['id'] }); | ||
}); | ||
parser.addListener('end', function () { | ||
inputTags.forEach(function (inputTag) { | ||
parser.addListener('end', () => { | ||
inputTags.forEach((inputTag) => { | ||
if (!hasMatchingLabelTag(inputTag)) { | ||
reportMessageCallback('No matching [ label ] tag found.', inputTag.event.line, inputTag.col, _this, inputTag.event.raw); | ||
reporter.warn('No matching [ label ] tag found.', inputTag.event.line, inputTag.col, this, inputTag.event.raw); | ||
} | ||
@@ -33,4 +32,4 @@ }); | ||
function hasMatchingLabelTag(inputTag) { | ||
var found = false; | ||
labelTags.forEach(function (labelTag) { | ||
let found = false; | ||
labelTags.forEach((labelTag) => { | ||
if (inputTag.id && inputTag.id === labelTag.forValue) { | ||
@@ -44,2 +43,2 @@ found = true; | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5wdXQtcmVxdWlyZXMtbGFiZWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY29yZS9ydWxlcy9pbnB1dC1yZXF1aXJlcy1sYWJlbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUdBLGtCQUFlO0lBQ2IsRUFBRSxFQUFFLHNCQUFzQjtJQUMxQixXQUFXLEVBQUUsOERBQThEO0lBQzNFLElBQUksRUFBSixVQUFLLE1BQU0sRUFBRSxxQkFBcUI7UUFBbEMsaUJBK0NDO1FBOUNDLElBQU0sU0FBUyxHQUlWLEVBQUUsQ0FBQTtRQUNQLElBQU0sU0FBUyxHQUFzRCxFQUFFLENBQUE7UUFFdkUsTUFBTSxDQUFDLFdBQVcsQ0FBQyxVQUFVLEVBQUUsVUFBQyxLQUFLO1lBQ25DLElBQU0sT0FBTyxHQUFHLEtBQUssQ0FBQyxPQUFPLENBQUMsV0FBVyxFQUFFLENBQUE7WUFDM0MsSUFBTSxRQUFRLEdBQUcsTUFBTSxDQUFDLFdBQVcsQ0FBQyxLQUFLLENBQUMsS0FBSyxDQUFDLENBQUE7WUFDaEQsSUFBTSxHQUFHLEdBQUcsS0FBSyxDQUFDLEdBQUcsR0FBRyxPQUFPLENBQUMsTUFBTSxHQUFHLENBQUMsQ0FBQTtZQUUxQyxJQUFJLE9BQU8sS0FBSyxPQUFPLEVBQUU7Z0JBQ3ZCLFNBQVMsQ0FBQyxJQUFJLENBQUMsRUFBRSxLQUFLLEVBQUUsS0FBSyxFQUFFLEdBQUcsRUFBRSxHQUFHLEVBQUUsRUFBRSxFQUFFLFFBQVEsQ0FBQyxJQUFJLENBQ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UFBO1lBQ0YsT0FBTyxLQUFLLENBQUE7UUFDZCxDQUFDO0lBQ0gsQ0FBQztDQUNNLENBQUEifQ== |
@@ -6,7 +6,6 @@ "use strict"; | ||
description: 'The <script> tag cannot be used.', | ||
init: function (parser, reportMessageCallback) { | ||
var _this = this; | ||
parser.addListener('tagstart', function (event) { | ||
init(parser, reporter) { | ||
parser.addListener('tagstart', (event) => { | ||
if (event.tagName.toLowerCase() === 'script') { | ||
reportMessageCallback('The <script> tag cannot be used.', event.line, event.col, _this, event.raw); | ||
reporter.error('The <script> tag cannot be used.', event.line, event.col, this, event.raw); | ||
} | ||
@@ -16,2 +15,2 @@ }); | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NyaXB0LWRpc2FibGVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvcmUvcnVsZXMvc2NyaXB0LWRpc2FibGVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBRUEsa0JBQWU7SUFDYixFQUFFLEVBQUUsaUJBQWlCO0lBQ3JCLFdBQVcsRUFBRSxrQ0FBa0M7SUFDL0MsSUFBSSxZQUFDLE1BQU0sRUFBRSxxQkFBcUI7UUFBbEMsaUJBWUM7UUFYQyxNQUFNLENBQUMsV0FBVyxDQUFDLFVBQVUsRUFBRSxVQUFDLEtBQUs7WUFDbkMsSUFBSSxLQUFLLENBQUMsT0FBTyxDQUFDLFdBQVcsRUFBRSxLQUFLLFFBQVEsRUFBRTtnQkFDNUMscUJBQXFCLENBQ25CLGtDQUFrQyxFQUNsQyxLQUFLLENBQUMsSUFBSSxFQUNWLEtBQUssQ0FBQyxHQUFHLEVBQ1QsS0FBSSxFQUNKLEtBQUssQ0FBQyxHQUFHLENBQ1YsQ0FBQTthQUNGO1FBQ0gsQ0FBQyxDQUFDLENBQUE7SUFDSixDQUFDO0NBQ00sQ0FBQSJ9 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NyaXB0LWRpc2FibGVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvcmUvcnVsZXMvc2NyaXB0LWRpc2FibGVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBRUEsa0JBQWU7SUFDYixFQUFFLEVBQUUsaUJBQWlCO0lBQ3JCLFdBQVcsRUFBRSxrQ0FBa0M7SUFDL0MsSUFBSSxDQUFDLE1BQU0sRUFBRSxRQUFRO1FBQ25CLE1BQU0sQ0FBQyxXQUFXLENBQUMsVUFBVSxFQUFFLENBQUMsS0FBSyxFQUFFLEVBQUU7WUFDdkMsSUFBSSxLQUFLLENBQUMsT0FBTyxDQUFDLFdBQVcsRUFBRSxLQUFLLFFBQVEsRUFBRTtnQkFDNUMsUUFBUSxDQUFDLEtBQUssQ0FDWixrQ0FBa0MsRUFDbEMsS0FBSyxDQUFDLElBQUksRUFDVixLQUFLLENBQUMsR0FBRyxFQUNULElBQUksRUFDSixLQUFLLENBQUMsR0FBRyxDQUNWLENBQUE7YUFDRjtRQUNILENBQUMsQ0FBQyxDQUFBO0lBQ0osQ0FBQztDQUNNLENBQUEifQ== |
@@ -6,23 +6,22 @@ "use strict"; | ||
description: 'Do not mix tabs and spaces for indentation.', | ||
init: function (parser, reportMessageCallback, options) { | ||
var _this = this; | ||
var _a, _b; | ||
var indentMode = (_a = options === null || options === void 0 ? void 0 : options.mode) !== null && _a !== void 0 ? _a : 'nomix'; | ||
var defaultSize = 4; | ||
var spaceLengthRequire = (options === null || options === void 0 ? void 0 : options.mode) === 'space' ? (_b = options === null || options === void 0 ? void 0 : options.size) !== null && _b !== void 0 ? _b : defaultSize : null; | ||
if (typeof spaceLengthRequire === 'number') { | ||
if (spaceLengthRequire <= 0 || spaceLengthRequire > 8) { | ||
spaceLengthRequire = defaultSize; | ||
init(parser, reporter, options) { | ||
let indentMode = 'nomix'; | ||
let spaceLengthRequire = null; | ||
if (typeof options === 'string') { | ||
const match = /^([a-z]+)(\d+)?/.exec(options); | ||
if (match) { | ||
indentMode = match[1]; | ||
spaceLengthRequire = match[2] && parseInt(match[2], 10); | ||
} | ||
} | ||
parser.addListener('text', function (event) { | ||
var raw = event.raw; | ||
var reMixed = /(^|\r?\n)([ \t]+)/g; | ||
var match; | ||
parser.addListener('text', (event) => { | ||
const raw = event.raw; | ||
const reMixed = /(^|\r?\n)([ \t]+)/g; | ||
let match; | ||
while ((match = reMixed.exec(raw))) { | ||
var fixedPos = parser.fixPos(event, match.index + match[1].length); | ||
const fixedPos = parser.fixPos(event, match.index + match[1].length); | ||
if (fixedPos.col !== 1) { | ||
continue; | ||
} | ||
var whiteSpace = match[2]; | ||
const whiteSpace = match[2]; | ||
if (indentMode === 'space') { | ||
@@ -32,3 +31,3 @@ if (spaceLengthRequire) { | ||
whiteSpace.length % spaceLengthRequire !== 0) { | ||
reportMessageCallback("Please use space for indentation and keep " + spaceLengthRequire + " length.", fixedPos.line, 1, _this, event.raw); | ||
reporter.warn(`Please use space for indentation and keep ${spaceLengthRequire} length.`, fixedPos.line, 1, this, event.raw); | ||
} | ||
@@ -38,3 +37,3 @@ } | ||
if (/^ +$/.test(whiteSpace) === false) { | ||
reportMessageCallback('Please use space for indentation.', fixedPos.line, 1, _this, event.raw); | ||
reporter.warn('Please use space for indentation.', fixedPos.line, 1, this, event.raw); | ||
} | ||
@@ -44,6 +43,6 @@ } | ||
else if (indentMode === 'tab' && /^\t+$/.test(whiteSpace) === false) { | ||
reportMessageCallback('Please use tab for indentation.', fixedPos.line, 1, _this, event.raw); | ||
reporter.warn('Please use tab for indentation.', fixedPos.line, 1, this, event.raw); | ||
} | ||
else if (/ +\t|\t+ /.test(whiteSpace) === true) { | ||
reportMessageCallback('Do not mix tabs and spaces for indentation.', fixedPos.line, 1, _this, event.raw); | ||
reporter.warn('Do not mix tabs and spaces for indentation.', fixedP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QSJ9 |
@@ -6,11 +6,10 @@ "use strict"; | ||
description: 'Special characters must be escaped.', | ||
init: function (parser, reportMessageCallback) { | ||
var _this = this; | ||
parser.addListener('text', function (event) { | ||
var raw = event.raw; | ||
var reSpecChar = /([<>])|( \& )/g; | ||
var match; | ||
init(parser, reporter) { | ||
parser.addListener('text', (event) => { | ||
const raw = event.raw; | ||
const reSpecChar = /([<>])|( \& )/g; | ||
let match; | ||
while ((match = reSpecChar.exec(raw))) { | ||
var fixedPos = parser.fixPos(event, match.index); | ||
reportMessageCallback("Special characters must be escaped : [ " + match[0] + " ].", fixedPos.line, fixedPos.col, _this, event.raw); | ||
const fixedPos = parser.fixPos(event, match.index); | ||
reporter.error(`Special characters must be escaped : [ ${match[0]} ].`, fixedPos.line, fixedPos.col, this, event.raw); | ||
} | ||
@@ -20,2 +19,2 @@ }); | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3BlYy1jaGFyLWVzY2FwZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb3JlL3J1bGVzL3NwZWMtY2hhci1lc2NhcGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFFQSxrQkFBZTtJQUNiLEVBQUUsRUFBRSxrQkFBa0I7SUFDdEIsV0FBVyxFQUFFLHFDQUFxQztJQUNsRCxJQUFJLFlBQUMsTUFBTSxFQUFFLHFCQUFxQjtRQUFsQyxpQkFrQkM7UUFqQkMsTUFBTSxDQUFDLFdBQVcsQ0FBQyxNQUFNLEVBQUUsVUFBQyxLQUFLO1lBQy9CLElBQU0sR0FBRyxHQUFHLEtBQUssQ0FBQyxHQUFHLENBQUE7WUFFckIsSUFBTSxVQUFVLEdBQUcsZ0JBQWdCLENBQUE7WUFDbkMsSUFBSSxLQUFLLENBQUE7WUFFVCxPQUFPLENBQUMsS0FBSyxHQUFHLFVBQVUsQ0FBQyxJQUFJ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FBQyxNQUFNLENBQUMsS0FBSyxFQUFFLEtBQUssQ0FBQyxLQUFLLENBQUMsQ0FBQTtnQkFDbEQsUUFBUSxDQUFDLEtBQUssQ0FDWiwwQ0FBMEMsS0FBSyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQ3ZELFFBQVEsQ0FBQyxJQUFJLEVBQ2IsUUFBUSxDQUFDLEdBQUcsRUFDWixJQUFJLEVBQ0osS0FBSyxDQUFDLEdBQUcsQ0FDVixDQUFBO2FBQ0Y7UUFDSCxDQUFDLENBQUMsQ0FBQTtJQUNKLENBQUM7Q0FDTSxDQUFBIn0= |
@@ -6,10 +6,9 @@ "use strict"; | ||
description: 'The src attribute of an img(script,link) must have a value.', | ||
init: function (parser, reportMessageCallback) { | ||
var _this = this; | ||
parser.addListener('tagstart', function (event) { | ||
var tagName = event.tagName; | ||
var attrs = event.attrs; | ||
var attr; | ||
var col = event.col + tagName.length + 1; | ||
for (var i = 0, l = attrs.length; i < l; i++) { | ||
init(parser, reporter) { | ||
parser.addListener('tagstart', (event) => { | ||
const tagName = event.tagName; | ||
const attrs = event.attrs; | ||
let attr; | ||
const col = event.col + tagName.length + 1; | ||
for (let i = 0, l = attrs.length; i < l; i++) { | ||
attr = attrs[i]; | ||
@@ -21,3 +20,3 @@ if (((/^(img|script|embed|bgsound|iframe)$/.test(tagName) === true && | ||
attr.value === '') { | ||
reportMessageCallback("The attribute [ " + attr.name + " ] of the tag [ " + tagName + " ] must have a value.", event.line, col + attr.index, _this, attr.raw); | ||
reporter.error(`The attribute [ ${attr.name} ] of the tag [ ${tagName} ] must have a value.`, event.line, col + attr.index, this, attr.raw); | ||
} | ||
@@ -28,2 +27,2 @@ } | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3JjLW5vdC1lbXB0eS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb3JlL3J1bGVzL3NyY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LENBQUMsQ0FBQyxDQUFBO2dCQUVmLElBQ0UsQ0FBQyxDQUFDLHFDQUFxQyxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsS0FBSyxJQUFJO29CQUM1RCxJQUFJLENBQUMsSUFBSSxLQUFLLEtBQUssQ0FBQztvQkFDcEIsQ0FBQyxPQUFPLEtBQUssTUFBTSxJQUFJLElBQUksQ0FBQyxJQUFJLEtBQUssTUFBTSxDQUFDO29CQUM1QyxDQUFDLE9BQU8sS0FBSyxRQUFRLElBQUksSUFBSSxDQUFDLElBQUksS0FBSyxNQUFNLENBQUMsQ0FBQztvQkFDakQsSUFBSSxDQUFDLEtBQUssS0FBSyxFQUFFLEVBQ2pCO29CQUNBLFFBQVEsQ0FBQyxLQUFLLENBQ1osbUJBQW1CLElBQUksQ0FBQyxJQUFJLG1CQUFtQixPQUFPLHVCQUF1QixFQUM3RSxLQUFLLENBQUMsSUFBSSxFQUNWLEdBQUcsR0FBRyxJQUFJLENBQUMsS0FBSyxFQUNoQixJQUFJLEVBQ0osSUFBSSxDQUFDLEdBQUcsQ0FDVCxDQUFBO2lCQUNGO2FBQ0Y7UUFDSCxDQUFDLENBQUMsQ0FBQTtJQUNKLENBQUM7Q0FDTSxDQUFBIn0= |
@@ -6,7 +6,6 @@ "use strict"; | ||
description: '<style> tags cannot be used.', | ||
init: function (parser, reportMessageCallback) { | ||
var _this = this; | ||
parser.addListener('tagstart', function (event) { | ||
init(parser, reporter) { | ||
parser.addListener('tagstart', (event) => { | ||
if (event.tagName.toLowerCase() === 'style') { | ||
reportMessageCallback('The <style> tag cannot be used.', event.line, event.col, _this, event.raw); | ||
reporter.warn('The <style> tag cannot be used.', event.line, event.col, this, event.raw); | ||
} | ||
@@ -16,2 +15,2 @@ }); | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3R5bGUtZGlzYWJsZWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi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BQyxJQUFJLENBQ1gsaUNBQWlDLEVBQ2pDLEtBQUssQ0FBQyxJQUFJLEVBQ1YsS0FBSyxDQUFDLEdBQUcsRUFDVCxJQUFJLEVBQ0osS0FBSyxDQUFDLEdBQUcsQ0FDVixDQUFBO2FBQ0Y7UUFDSCxDQUFDLENBQUMsQ0FBQTtJQUNKLENBQUM7Q0FDTSxDQUFBIn0= |
@@ -6,8 +6,7 @@ "use strict"; | ||
description: 'Tag must be paired.', | ||
init: function (parser, reportMessageCallback) { | ||
var _this = this; | ||
var stack = []; | ||
var mapEmptyTags = parser.makeMap('area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,track,command,source,keygen,wbr'); | ||
parser.addListener('tagstart', function (event) { | ||
var tagName = event.tagName.toLowerCase(); | ||
init(parser, reporter) { | ||
const stack = []; | ||
const mapEmptyTags = parser.makeMap('area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,track,command,source,keygen,wbr'); | ||
parser.addListener('tagstart', (event) => { | ||
const tagName = event.tagName.toLowerCase(); | ||
if (mapEmptyTags[tagName] === undefined && !event.close) { | ||
@@ -21,5 +20,5 @@ stack.push({ | ||
}); | ||
parser.addListener('tagend', function (event) { | ||
var tagName = event.tagName.toLowerCase(); | ||
var pos; | ||
parser.addListener('tagend', (event) => { | ||
const tagName = event.tagName.toLowerCase(); | ||
let pos; | ||
for (pos = stack.length - 1; pos >= 0; pos--) { | ||
@@ -31,9 +30,9 @@ if (stack[pos].tagName === tagName) { | ||
if (pos >= 0) { | ||
var arrTags = []; | ||
for (var i = stack.length - 1; i > pos; i--) { | ||
arrTags.push("</" + stack[i].tagName + ">"); | ||
const arrTags = []; | ||
for (let i = stack.length - 1; i > pos; i--) { | ||
arrTags.push(`</${stack[i].tagName}>`); | ||
} | ||
if (arrTags.length > 0) { | ||
var lastEvent = stack[stack.length - 1]; | ||
reportMessageCallback("Tag must be paired, missing: [ " + arrTags.join('') + " ], start tag match failed [ " + lastEvent.raw + " ] on line " + lastEvent.line + ".", event.line, event.col, _this, event.raw); | ||
const lastEvent = stack[stack.length - 1]; | ||
reporter.error(`Tag must be paired, missing: [ ${arrTags.join('')} ], start tag match failed [ ${lastEvent.raw} ] on line ${lastEvent.line}.`, event.line, event.col, this, event.raw); | ||
} | ||
@@ -43,13 +42,13 @@ stack.length = pos; | ||
else { | ||
reportMessageCallback("Tag must be paired, no start tag: [ " + event.raw + " ]", event.line, event.col, _this, event.raw); | ||
reporter.error(`Tag must be paired, no start tag: [ ${event.raw} ]`, event.line, event.col, this, event.raw); | ||
} | ||
}); | ||
parser.addListener('end', function (event) { | ||
var arrTags = []; | ||
for (var i = stack.length - 1; i >= 0; i--) { | ||
arrTags.push("</" + stack[i].tagName + ">"); | ||
parser.addListener('end', (event) => { | ||
const arrTags = []; | ||
for (let i = stack.length - 1; i >= 0; i--) { | ||
arrTags.push(`</${stack[i].tagName}>`); | ||
} | ||
if (arrTags.length > 0) { | ||
var lastEvent = stack[stack.length - 1]; | ||
reportMessageCallback("Tag must be paired, missing: [ " + arrTags.join('') + " ], open tag match failed [ " + lastEvent.raw + " ] on line " + lastEvent.line + ".", event.line, event.col, _this, ''); | ||
const lastEvent = stack[stack.length - 1]; | ||
reporter.error(`Tag must be paired, missing: [ ${arrTags.join('')} ], open tag match failed [ ${lastEvent.raw} ] on line ${lastEvent.line}.`, event.line, event.col, this, ''); | ||
} | ||
@@ -59,2 +58,2 @@ }); | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFnLXBhaXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY29yZS9ydWxlcy90YWctcGFpci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUdBLGtCQUFlO0lBQ2IsRUFBRSxFQUFFLFVBQVU7SUFDZCxXQUFXLEVBQUUscUJBQXFCO0lBQ2xDLElBQUksRUFBSixVQUFLLE1BQU0sRU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FBQyxFQUFFLENBQUMsRUFBRSxFQUFFO2dCQUMxQyxPQUFPLENBQUMsSUFBSSxDQUFDLEtBQUssS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLE9BQU8sR0FBRyxDQUFDLENBQUE7YUFDdkM7WUFFRCxJQUFJLE9BQU8sQ0FBQyxNQUFNLEdBQUcsQ0FBQyxFQUFFO2dCQUN0QixNQUFNLFNBQVMsR0FBRyxLQUFLLENBQUMsS0FBSyxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsQ0FBQTtnQkFDekMsUUFBUSxDQUFDLEtBQUssQ0FDWixrQ0FBa0MsT0FBTyxDQUFDLElBQUksQ0FDNUMsRUFBRSxDQUNILCtCQUErQixTQUFTLENBQUMsR0FBRyxjQUMzQyxTQUFTLENBQUMsSUFDWixHQUFHLEVBQ0gsS0FBSyxDQUFDLElBQUksRUFDVixLQUFLLENBQUMsR0FBRyxFQUNULElBQUksRUFDSixFQUFFLENBQ0gsQ0FBQTthQUNGO1FBQ0gsQ0FBQyxDQUFDLENBQUE7SUFDSixDQUFDO0NBQ00sQ0FBQSJ9 |
@@ -6,10 +6,9 @@ "use strict"; | ||
description: 'Empty tags must be self closed.', | ||
init: function (parser, reportMessageCallback) { | ||
var _this = this; | ||
var mapEmptyTags = parser.makeMap('area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,track,command,source,keygen,wbr'); | ||
parser.addListener('tagstart', function (event) { | ||
var tagName = event.tagName.toLowerCase(); | ||
init(parser, reporter) { | ||
const mapEmptyTags = parser.makeMap('area,base,basefont,bgsound,br,col,frame,hr,img,input,isindex,link,meta,param,embed,track,command,source,keygen,wbr'); | ||
parser.addListener('tagstart', (event) => { | ||
const tagName = event.tagName.toLowerCase(); | ||
if (mapEmptyTags[tagName] !== undefined) { | ||
if (!event.close) { | ||
reportMessageCallback("The empty tag : [ " + tagName + " ] must be self closed.", event.line, event.col, _this, event.raw); | ||
reporter.warn(`The empty tag : [ ${tagName} ] must be self closed.`, event.line, event.col, this, event.raw); | ||
} | ||
@@ -20,2 +19,2 @@ } | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFnLXNlbGYtY2xvc2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY29yZS9ydWxlcy90YWctc2VsZi1jbG9zZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBLGtCQUFlO0lBQ2IsRUFBRSxFQUFFLGdCQUFnQjtJQUNwQixXQUFXLEVBQUUsaUNBQWlDO0lBQzlDLElBQUksWUFBQyxNQUFNLEVBQUUscUJBQXFCO1FBQWxDLGlCQW1CQztRQWxCQyxJQUFNLFlBQVksR0FBRyxNQUFNLENBQUMsT0FBTyxDQUNqQyw0R0FBNEcsQ0FDN0csQ0FBQTtRQUVELE1BQU0sQ0FBQyxXQUFXLENBQUMsVUFBVSxFQUFFLFVBQUMsS0FBSztZQUNuQyxJQUFNLE9BQU8sR0FBRyxLQUFLLENBQUMsT0FBTyxDQUFDLFdBQVcsRUFBRSxDQUFBO1lBQzNDLElBQUksWUFBWSxDQUFDLE9BQU8sQ0FBQyxLQUFLLFNBQVMsRUFBRTtnQkFDdkMsSUFBSSxDQUFDLEtBQUssQ0FBQyxLQUFLLEVBQUU7b0JBQ2hCLHFCQUFxQixDQUNuQix1QkFBcUIsT0FBTyw0QkFBeUIsRUFDckQsS0FBSyxDQUFDLElBQUksRUFDVixLQUFLLENBQUMsR0FBRyxFQUNULEtBQUksRUFDSixLQUFLLENBQUMsR0FBRyxDQUNWLENBQUE7aUJBQ0Y7YUFDRjtRQUNILENBQUMsQ0FBQyxDQUFBO0lBQ0osQ0FBQztDQUNNLENBQUEifQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFnLXNlbGYtY2xvc2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY29yZS9ydWxlcy90YWctc2VsZi1jbG9zZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBLGtCQUFlO0lBQ2IsRUFBRSxFQUFFLGdCQUFnQjtJQUNwQixXQUFXLEVBQUUsaUNBQWlDO0lBQzlDLElBQUksQ0FBQyxNQUFNLEVBQUUsUUFBUTtRQUNuQixNQUFNLFlBQVksR0FBRyxNQUFNLENBQUMsT0FBTyxDQUNqQyxvSEFBb0gsQ0FDckgsQ0FBQTtRQUVELE1BQU0sQ0FBQyxXQUFXLENBQUMsVUFBVSxFQUFFLENBQUMsS0FBSyxFQUFFLEVBQUU7WUFDdkMsTUFBTSxPQUFPLEdBQUcsS0FBSyxDQUFDLE9BQU8sQ0FBQyxXQUFXLEVBQUUsQ0FBQTtZQUMzQyxJQUFJLFlBQVksQ0FBQyxPQUFPLENBQUMsS0FBSyxTQUFTLEVBQUU7Z0JBQ3ZDLElBQUksQ0FBQyxLQUFLLENBQUMsS0FBSyxFQUFFO29CQUNoQixRQUFRLENBQUMsSUFBSSxDQUNYLHFCQUFxQixPQUFPLHlCQUF5QixFQUNyRCxLQUFLLENBQUMsSUFBSSxFQUNWLEtBQUssQ0FBQyxHQUFHLEVBQ1QsSUFBSSxFQUNKLEtBQUssQ0FBQyxHQUFHLENBQ1YsQ0FBQTtpQkFDRjthQUNGO1FBQ0gsQ0FBQyxDQUFDLENBQUE7SUFDSixDQUFDO0NBQ00sQ0FBQSJ9 |
@@ -6,11 +6,11 @@ "use strict"; | ||
description: 'All html element names must be in lowercase.', | ||
init: function (parser, reportMessageCallback, options) { | ||
var _this = this; | ||
var _a; | ||
var exceptions = (_a = options === null || options === void 0 ? void 0 : options.exceptions) !== null && _a !== void 0 ? _a : []; | ||
parser.addListener('tagstart,tagend', function (event) { | ||
var tagName = event.tagName; | ||
init(parser, reporter, options) { | ||
const exceptions = Array.isArray(options) | ||
? options | ||
: []; | ||
parser.addListener('tagstart,tagend', (event) => { | ||
const tagName = event.tagName; | ||
if (exceptions.indexOf(tagName) === -1 && | ||
tagName !== tagName.toLowerCase()) { | ||
reportMessageCallback("The html element name of [ " + tagName + " ] must be in lowercase.", event.line, event.col, _this, event.raw); | ||
reporter.error(`The html element name of [ ${tagName} ] must be in lowercase.`, event.line, event.col, this, event.raw); | ||
} | ||
@@ -20,2 +20,2 @@ }); | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFnbmFtZS1sb3dlcmNhc2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY29yZS9ydWxlcy90YWduYW1lLWxvd2VyY2FzZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBLGtCQUFlO0lBQ2IsRUFBRSxFQUFFLG1CQUFtQjtJQUN2QixXQUFXLEVBQUUsOENBQThDO0lBQzNELElBQUksRUFBSixVQUFLLE1BQU0sRUFBRSxxQkFBcUIsRUFBRSxPQUFrQztRQUF0RSxpQkFrQkM7O1FBakJDLElBQU0sVUFBVSxTQUFhLE9BQU8sYUFBUCxPQUFPLHVCQUFQLE9BQU8sQ0FBRSxVQUFVLG1DQUFJLEVBQUUsQ0FBQTtRQUV0RCxNQUFNLENBQUMsV0FBVyxDQUFDLGlCQUFpQixFQUFFLFVBQUMsS0FBSztZQUMxQyxJQUFNLE9BQU8sR0FBRyxLQUFLLENBQUMsT0FBTyxDQUFBO1lBQzdCLElBQ0UsVUFBVSxDQUFDLE9BQU8sQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDLENBQUM7Z0JBQ2xDLE9BQU8sS0FBSyxPQUFPLENBQUMsV0FBVyxFQUFFLEVBQ2pDO2dCQUNBLHFCQUFxQixDQUNuQixnQ0FBOEIsT0FBTyw2QkFBMEIsRUFDL0QsS0FBSyxDQUFDLElBQUksRUFDVixLQUFLLENBQUMsR0FBRyxFQUNULEtBQUksRUF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QUNKLENBQUM7Q0FDTSxDQUFBIn0= |
@@ -5,10 +5,9 @@ "use strict"; | ||
id: 'tagname-specialchars', | ||
description: 'All html element names must be in lowercase.', | ||
init: function (parser, reportMessageCallback) { | ||
var _this = this; | ||
var specialchars = /[^a-zA-Z0-9\-:_]/; | ||
parser.addListener('tagstart,tagend', function (event) { | ||
var tagName = event.tagName; | ||
description: 'All special characters must be escaped.', | ||
init(parser, reporter) { | ||
const specialchars = /[^a-zA-Z0-9\-:_]/; | ||
parser.addListener('tagstart,tagend', (event) => { | ||
const tagName = event.tagName; | ||
if (specialchars.test(tagName)) { | ||
reportMessageCallback("The html element name of [ " + tagName + " ] contains special character.", event.line, event.col, _this, event.raw); | ||
reporter.error(`The html element name of [ ${tagName} ] contains special character.`, event.line, event.col, this, event.raw); | ||
} | ||
@@ -18,2 +17,2 @@ }); | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFnbmFtZS1zcGVjaWFsY2hhcnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY29yZS9ydWxlcy90YWduYW1lLXNwZWNpYWxjaGFycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBLGtCQUFlO0lBQ2IsRUFBRSxFQUFFLHNCQUFzQjtJQUMxQixXQUFXLEVBQUUsOENBQThDO0lBQzNELElBQUksWUFBQyxNQUFNLEVBQUUscUJBQXFCO1FBQWxDLGlCQWVDO1FBZEMsSUFBTSxZQUFZLEdBQUcsa0JBQWtCLENBQUE7UUFFdkMsTUFBTSxDQUFDLFdBQVcsQ0FBQyxpQkFBaUIsRUFBRSxVQUFDLEtBQUs7WUFDMUMsSUFBTSxPQUFPLEdBQUcsS0FBSyxDQUFDLE9BQU8sQ0FBQTtZQUM3QixJQUFJLFlBQVksQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLEVBQUU7Z0JBQzlCLHFCQUFxQixDQUNuQixnQ0FBOEIsT0FBTyxtQ0FBZ0MsRUFDckUsS0FBSyxDQUFDLElBQUksRUFDVixLQUFLLENBQUMsR0FBRyxFQUNULEtBQUksRUFDSixLQUFLLENBQUMsR0FBRyxDQUNWLENBQUE7YUFDRjtRQUNILENBQUMsQ0FBQyxDQUFBO0lBQ0osQ0FBQztDQUNNLENBQUEifQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFnbmFtZS1zcGVjaWFsY2hhcnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY29yZS9ydWxlcy90YWduYW1lLXNwZWNpYWxjaGFycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBLGtCQUFlO0lBQ2IsRUFBRSxFQUFFLHNCQUFzQjtJQUMxQixXQUFXLEVBQUUseUNBQXlDO0lBQ3RELElBQUksQ0FBQyxNQUFNLEVBQUUsUUFBUTtRQUNuQixNQUFNLFlBQVksR0FBRyxrQkFBa0IsQ0FBQTtRQUV2QyxNQUFNLENBQUMsV0FBVyxDQUFDLGlCQUFpQixFQUFFLENBQUMsS0FBSyxFQUFFLEVBQUU7WUFDOUMsTUFBTSxPQUFPLEdBQUcsS0FBSyxDQUFDLE9BQU8sQ0FBQTtZQUM3QixJQUFJLFlBQVksQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLEVBQUU7Z0JBQzlCLFFBQVEsQ0FBQyxLQUFLLENBQ1osOEJBQThCLE9BQU8sZ0NBQWdDLEVBQ3JFLEtBQUssQ0FBQyxJQUFJLEVBQ1YsS0FBSyxDQUFDLEdBQUcsRUFDVCxJQUFJLEVBQ0osS0FBSyxDQUFDLEdBQUcsQ0FDVixDQUFBO2FBQ0Y7UUFDSCxDQUFDLENBQUMsQ0FBQTtJQUNKLENBQUM7Q0FDTSxDQUFBIn0= |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tagsTypings = { | ||
let tagsTypings = { | ||
a: { | ||
@@ -45,29 +34,28 @@ selfclosing: false, | ||
description: 'Checks html tags.', | ||
init: function (parser, reportMessageCallback, options) { | ||
var _this = this; | ||
tagsTypings = __assign(__assign({}, tagsTypings), options); | ||
parser.addListener('tagstart', function (event) { | ||
var attrs = event.attrs; | ||
var col = event.col + event.tagName.length + 1; | ||
var tagName = event.tagName.toLowerCase(); | ||
init(parser, reporter, options) { | ||
tagsTypings = Object.assign(Object.assign({}, tagsTypings), options); | ||
parser.addListener('tagstart', (event) => { | ||
const attrs = event.attrs; | ||
const col = event.col + event.tagName.length + 1; | ||
const tagName = event.tagName.toLowerCase(); | ||
if (tagsTypings[tagName]) { | ||
var currentTagType = tagsTypings[tagName]; | ||
const currentTagType = tagsTypings[tagName]; | ||
if (currentTagType.selfclosing === true && !event.close) { | ||
reportMessageCallback("The <" + tagName + "> tag must be selfclosing.", event.line, event.col, _this, event.raw); | ||
reporter.warn(`The <${tagName}> tag must be selfclosing.`, event.line, event.col, this, event.raw); | ||
} | ||
else if (currentTagType.selfclosing === false && event.close) { | ||
reportMessageCallback("The <" + tagName + "> tag must not be selfclosing.", event.line, event.col, _this, event.raw); | ||
reporter.warn(`The <${tagName}> tag must not be selfclosing.`, event.line, event.col, this, event.raw); | ||
} | ||
if (Array.isArray(currentTagType.attrsRequired)) { | ||
var attrsRequired = currentTagType.attrsRequired; | ||
attrsRequired.forEach(function (id) { | ||
const attrsRequired = currentTagType.attrsRequired; | ||
attrsRequired.forEach((id) => { | ||
if (Array.isArray(id)) { | ||
var copyOfId = id.map(function (a) { return a; }); | ||
var realID_1 = copyOfId.shift(); | ||
var values_1 = copyOfId; | ||
if (attrs.some(function (attr) { return attr.name === realID_1; })) { | ||
attrs.forEach(function (attr) { | ||
if (attr.name === realID_1 && | ||
values_1.indexOf(attr.value) === -1) { | ||
reportMessageCallback("The <" + tagName + "> tag must have attr '" + realID_1 + "' with one value of '" + values_1.join("' or '") + "'.", event.line, col, _this, event.raw); | ||
const copyOfId = id.map((a) => a); | ||
const realID = copyOfId.shift(); | ||
const values = copyOfId; | ||
if (attrs.some((attr) => attr.name === realID)) { | ||
attrs.forEach((attr) => { | ||
if (attr.name === realID && | ||
values.indexOf(attr.value) === -1) { | ||
reporter.error(`The <${tagName}> tag must have attr '${realID}' with one value of '${values.join("' or '")}'.`, event.line, col, this, event.raw); | ||
} | ||
@@ -77,7 +65,7 @@ }); | ||
else { | ||
reportMessageCallback("The <" + tagName + "> tag must have attr '" + realID_1 + "'.", event.line, col, _this, event.raw); | ||
reporter.error(`The <${tagName}> tag must have attr '${realID}'.`, event.line, col, this, event.raw); | ||
} | ||
} | ||
else if (!attrs.some(function (attr) { return id.split('|').indexOf(attr.name) !== -1; })) { | ||
reportMessageCallback("The <" + tagName + "> tag must have attr '" + id + "'.", event.line, col, _this, event.raw); | ||
else if (!attrs.some((attr) => id.split('|').indexOf(attr.name) !== -1)) { | ||
reporter.error(`The <${tagName}> tag must have attr '${id}'.`, event.line, col, this, event.raw); | ||
} | ||
@@ -87,13 +75,13 @@ }); | ||
if (Array.isArray(currentTagType.attrsOptional)) { | ||
var attrsOptional = currentTagType.attrsOptional; | ||
attrsOptional.forEach(function (id) { | ||
const attrsOptional = currentTagType.attrsOptional; | ||
attrsOptional.forEach((id) => { | ||
if (Array.isArray(id)) { | ||
var copyOfId = id.map(function (a) { return a; }); | ||
var realID_2 = copyOfId.shift(); | ||
var values_2 = copyOfId; | ||
if (attrs.some(function (attr) { return attr.name === realID_2; })) { | ||
attrs.forEach(function (attr) { | ||
if (attr.name === realID_2 && | ||
values_2.indexOf(attr.value) === -1) { | ||
reportMessageCallback("The <" + tagName + "> tag must have optional attr '" + realID_2 + "' with one value of '" + values_2.join("' or '") + "'.", event.line, col, _this, event.raw); | ||
const copyOfId = id.map((a) => a); | ||
const realID = copyOfId.shift(); | ||
const values = copyOfId; | ||
if (attrs.some((attr) => attr.name === realID)) { | ||
attrs.forEach((attr) => { | ||
if (attr.name === realID && | ||
values.indexOf(attr.value) === -1) { | ||
reporter.error(`The <${tagName}> tag must have optional attr '${realID}' with one value of '${values.join("' or '")}'.`, event.line, col, this, event.raw); | ||
} | ||
@@ -106,6 +94,6 @@ }); | ||
if (Array.isArray(currentTagType.redundantAttrs)) { | ||
var redundantAttrs = currentTagType.redundantAttrs; | ||
redundantAttrs.forEach(function (attrName) { | ||
if (attrs.some(function (attr) { return attr.name === attrName; })) { | ||
reportMessageCallback("The attr '" + attrName + "' is redundant for <" + tagName + "> and should be ommited.", event.line, col, _this, event.raw); | ||
const redundantAttrs = currentTagType.redundantAttrs; | ||
redundantAttrs.forEach((attrName) => { | ||
if (attrs.some((attr) => attr.name === attrName)) { | ||
reporter.error(`The attr '${attrName}' is redundant for <${tagName}> and should be omitted.`, event.line, col, this, event.raw); | ||
} | ||
@@ -118,2 +106,2 @@ }); | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFncy1jaGVjay5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb3JlL3J1bGVzL3RhZ3MtY2hlY2sudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7OztBQUVBLElBQUksV0FBVyxHQUE0QztJQUN6RCxDQUFDLEVBQUU7UUFDRCxXQUFXLEVBQUUsS0FBSztRQUNsQixhQUFhLEVBQUUsQ0FBQyxNQUFNLEVBQUUsT0FBTyxDQUFDO1FBQ2hDLGNBQWMsRUFBRSxDQUFDLEtBQUssQ0FBQztLQUN4QjtJQUNELE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BQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxLQUFLLENBQUMsQ0FBQyxFQUNqQzt3Q0FDQSxRQUFRLENBQUMsS0FBSyxDQUNaLFFBQVEsT0FBTyxrQ0FBa0MsTUFBTSx3QkFBd0IsTUFBTSxDQUFDLElBQUksQ0FDeEYsUUFBUSxDQUNULElBQUksRUFDTCxLQUFLLENBQUMsSUFBSSxFQUNWLEdBQUcsRUFDSCxJQUFJLEVBQ0osS0FBSyxDQUFDLEdBQUcsQ0FDVixDQUFBO3FDQUNGO2dDQUNILENBQUMsQ0FBQyxDQUFBOzZCQUNIO3lCQUNGO29CQUNILENBQUMsQ0FBQyxDQUFBO2lCQUNIO2dCQUVELElBQUksS0FBSyxDQUFDLE9BQU8sQ0FBQyxjQUFjLENBQUMsY0FBYyxDQUFDLEVBQUU7b0JBQ2hELE1BQU0sY0FBYyxHQUFhLGNBQWMsQ0FBQyxjQUFjLENBQUE7b0JBQzlELGNBQWMsQ0FBQyxPQUFPLENBQUMsQ0FBQyxRQUFRLEVBQUUsRUFBRTt3QkFDbEMsSUFBSSxLQUFLLENBQUMsSUFBSSxDQUFDLENBQUMsSUFBSSxFQUFFLEVBQUUsQ0FBQyxJQUFJLENBQUMsSUFBSSxLQUFLLFFBQVEsQ0FBQyxFQUFFOzRCQUNoRCxRQUFRLENBQUMsS0FBSyxDQUNaLGFBQWEsUUFBUSx1QkFBdUIsT0FBTywwQkFBMEIsRUFDN0UsS0FBSyxDQUFDLElBQUksRUFDVixHQUFHLEVBQ0gsSUFBSSxFQUNKLEtBQUssQ0FBQyxHQUFHLENBQ1YsQ0FBQTt5QkFDRjtvQkFDSCxDQUFDLENBQUMsQ0FBQTtpQkFDSDthQUNGO1FBQ0gsQ0FBQyxDQUFDLENBQUE7SUFDSixDQUFDO0NBQ00sQ0FBQSJ9 |
@@ -6,8 +6,7 @@ "use strict"; | ||
description: '<title> must be present in <head> tag.', | ||
init: function (parser, reportMessageCallback) { | ||
var _this = this; | ||
var headBegin = false; | ||
var hasTitle = false; | ||
var onTagStart = function (event) { | ||
var tagName = event.tagName.toLowerCase(); | ||
init(parser, reporter) { | ||
let headBegin = false; | ||
let hasTitle = false; | ||
const onTagStart = (event) => { | ||
const tagName = event.tagName.toLowerCase(); | ||
if (tagName === 'head') { | ||
@@ -20,9 +19,9 @@ headBegin = true; | ||
}; | ||
var onTagEnd = function (event) { | ||
var tagName = event.tagName.toLowerCase(); | ||
const onTagEnd = (event) => { | ||
const tagName = event.tagName.toLowerCase(); | ||
if (hasTitle && tagName === 'title') { | ||
var lastEvent = event.lastEvent; | ||
const lastEvent = event.lastEvent; | ||
if (lastEvent.type !== 'text' || | ||
(lastEvent.type === 'text' && /^\s*$/.test(lastEvent.raw) === true)) { | ||
reportMessageCallback('<title></title> must not be empty.', event.line, event.col, _this, event.raw); | ||
reporter.error('<title></title> must not be empty.', event.line, event.col, this, event.raw); | ||
} | ||
@@ -32,3 +31,3 @@ } | ||
if (hasTitle === false) { | ||
reportMessageCallback('<title> must be present in <head> tag.', event.line, event.col, _this, event.raw); | ||
reporter.error('<title> must be present in <head> tag.', event.line, event.col, this, event.raw); | ||
} | ||
@@ -43,2 +42,2 @@ parser.removeListener('tagstart', onTagStart); | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGl0bGUtcmVxdWlyZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb3JlL3J1bGVzL3RpdGxlLXJlcXVpcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFHQSxrQkFBZTtJQUNiLEVBQUUsRUFBRSxlQUFlO0lBQ25CLFdBQVcsRUFBRSx3Q0FBd0M7SUFDckQsSUFBSSxFQUFKLFVBQUssTUFBTSxFQUFFLHFCQUFxQjtRQUFsQyxpQkFpREM7UUFoREMsSUFBSSxTQUFTLEdBQUcsS0FBSyxDQUFBO1FBQ3JCLEl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FVLENBQUMsQ0FBQTtnQkFDN0MsTUFBTSxDQUFDLGNBQWMsQ0FBQyxRQUFRLEVBQUUsUUFBUSxDQUFDLENBQUE7YUFDMUM7UUFDSCxDQUFDLENBQUE7UUFFRCxNQUFNLENBQUMsV0FBVyxDQUFDLFVBQVUsRUFBRSxVQUFVLENBQUMsQ0FBQTtRQUMxQyxNQUFNLENBQUMsV0FBVyxDQUFDLFFBQVEsRUFBRSxRQUFRLENBQUMsQ0FBQTtJQUN4QyxDQUFDO0NBQ00sQ0FBQSJ9 |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isRuleSeverity = void 0; | ||
function isRuleSeverity(value) { | ||
if (typeof value !== 'string') { | ||
return false; | ||
} | ||
switch (value) { | ||
case 'off': | ||
case 'warn': | ||
case 'error': | ||
return true; | ||
default: | ||
return false; | ||
} | ||
} | ||
exports.isRuleSeverity = isRuleSeverity; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29yZS90eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFnQkEsU0FBZ0IsY0FBYyxDQUFDLEtBQWM7SUFDM0MsSUFBSSxPQUFPLEtBQUssS0FBSyxRQUFRLEVBQUU7UUFDN0IsT0FBTyxLQUFLLENBQUE7S0FDYjtJQUNELFFBQVEsS0FBSyxFQUFFO1FBQ2IsS0FBSyxLQUFLLENBQUM7UUFDWCxLQUFLLE1BQU0sQ0FBQztRQUNaLEtBQUssT0FBTztZQUNWLE9BQU8sSUFBSSxDQUFBO1FBQ2I7WUFDRSxPQUFPLEtBQUssQ0FBQTtLQUNmO0FBQ0gsQ0FBQztBQVpELHdDQVlDIn0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29yZS90eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0= |
@@ -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";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function n(e,t,a){return e(a={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&a.path)}},a.exports),a.exports}var r=n((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=this,l=this._mapCdataTags,u=/<(?:\/([^\s>]+)\s*|!--([\s\S]*?)--|!([^>]*?)|([\w\-:]+)((?:\s+[^\s"'>\/=\x00-\x0F\x7F\x80-\x9F]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'>]*))?)*?)\s*(\/?))>/g,d=/\s*([^\s"'>\/=\x00-\x0F\x7F\x80-\x9F]+)(?:\s*=\s*(?:(")([^"]*)"|(')([^']*)'|([^\s"'>]*)))?/g,c=/\r?\n/g,f=0,p=null,v=[],g=0,h=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-h+1;for(void 0===n&&(n={}),n.raw=t,n.pos=a,n.line=m,n.col=r,b.push(n),o.fire(e,n);c.exec(t);)m++,h=a+c.lastIndex};t=u.exec(e);)if((a=t.index)>f&&(s=e.substring(f,a),p?v.push(s):y("text",s,f)),f=u.lastIndex,!(n=t[1])||(p&&n===p&&(y("cdata",s=v.join(""),g,{tagName:p,attrs:i}),p=null,i=void 0,v=[]),p))if(p)v.push(t[0]);else if(n=t[4]){r=[];for(var w=t[5],L=void 0,O=0;L=d.exec(w);){var _=L[1],j=L[2]?L[2]:L[4]?L[4]:"",x=L[3]?L[3]:L[5]?L[5]:L[6]?L[6]:"";r.push({name:_,value:x,quote:j,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]}),l[n]&&(p=n,i=r.concat(),v=[],g=f)):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>f&&y("text",s=e.substring(f,e.length),f),this.fire("end",{pos:f,line:m,col:e.length-h+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}));a(r);var i=n((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=/\r?\n/.exec(e);this.brLen=null!==a?a[0].length:0,this.ruleset=t,this.messages=[]}return e.prototype.info=function(e,t,a,n,r){this.report("info",e,t,a,n,r)},e.prototype.warn=function(e,t,a,n,r){this.report("warning",e,t,a,n,r)},e.prototype.error=function(e,t,a,n,r){this.report("error",e,t,a,n,r)},e.prototype.report=function(e,t,a,n,r,i){for(var s=this.lines,o=this.brLen,l="",u=0,d=a-1,c=s.length;d<c&&(n>(u=(l=s[d]).length)&&a<c);d++)a++,1!==(n-=u)&&(n-=o);this.messages.push({type:e,message:t,raw:i,evidence:l,line:a,col:n,rule:{id:r.id,description:r.description,link:"https://github.com/thedaviddias/HTMLHint/wiki/"+r.id}})},e}();t.default=a}));a(i);var s=n((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=n.tagName.toLowerCase(),i=e.getMapAttrs(n.attrs),s=n.col+r.length+1;"img"!==r||"alt"in i?("area"===r&&"href"in i||"input"===r&&"image"===i.type)&&("alt"in i&&""!==i.alt||t("The alt attribute of "+("area"===r?"area[href]":"input[type=image]")+" must have a value.",n.line,s,a,n.raw)):t("An alt attribute must be present on <img> elements.",n.line,s,a,n.raw)}))}}}));a(s);var o=n((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,r=this,i=null!==(n=null==a?void 0:a.exceptions)&&void 0!==n?n:[];e.addListener("tagstart",(function(e){for(var a,n=e.attrs,s=e.col+e.tagName.length+1,o=function(o,l){var u=(a=n[o]).name;i.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("The attribute name of [ "+u+" ] must be in lowercase.",e.line,s+a.index,r,a.raw)},l=0,u=n.length;l<u;l++)o(l)}))}}}));a(o);var l=n((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("Inaccurate order "+o+" should be in hierarchy "+JSON.stringify(i)+" ",e.line,e.col,a,e.raw)}))}}}));a(l);var u=n((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("Duplicate of attribute name [ "+n.name+" ] was found.",e.line,s+n.index,a,n.raw),o[r]=!0}))}}}));a(u);var d=n((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(n=i[l],null!==(r=o.exec(n.value))){var d=escape(r[0]).replace(/%u/,"\\u").replace(/%/,"\\x");t("The value of attribute [ "+n.name+" ] cannot contain an unsafe char [ "+d+" ].",e.line,s+n.index,a,n.raw)}}))}}}));a(d);var c=n((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("The value of attribute [ "+n.name+" ] must be in double quotes.",e.line,i+n.index,a,n.raw)}))}}}));a(c);var f=n((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("The attribute [ "+n.name+" ] must have a value.",e.line,i+n.index,a,n.raw)}))}}}));a(f);var p=n((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("The value of attribute [ "+n.name+" ] must be in single quotes.",e.line,i+n.index,a,n.raw)}))}}}));a(p);var v=n((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,r=this,i=null!==(n=null==a?void 0:a.exceptions)&&void 0!==n?n:[];e.addListener("tagstart",(function(e){var a,n=e.attrs,s=e.col+e.tagName.length+1;n.forEach((function(n){a=n;var o=n.name;-1===i.indexOf(o)&&(n.value.trim()!==n.value&&t("The attributes of [ "+o+" ] must not have trailing whitespace.",e.line,s+a.index,r,a.raw),n.value.replace(/ +(?= )/g,"")!==n.value&&t("The attributes of [ "+o+" ] must be separated by only one space.",e.line,s+a.index,r,a.raw))}))}))}}}));a(v);var g=n((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("Doctype must be declared first.",r.line,r.col,a,r.raw),e.removeListener("all",n))};e.addListener("all",n)}}}));a(g);var h=n((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('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)}}}));a(h);var m=n((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("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)}}}));a(m);var b=n((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,r=this,i=null!==(n=null==a?void 0:a.mode)&&void 0!==n?n:"absolute";e.addListener("tagstart",(function(e){for(var a,n=e.attrs,s=e.col+e.tagName.length+1,o=0,l=n.length;o<l;o++)if("href"===(a=n[o]).name){("absolute"===i&&!1===/^\w+?:/.test(a.value)||"relative"===i&&!0===/^https?:\/\//.test(a.value))&&t("The value of the href attribute [ "+a.value+" ] must be "+i+".",e.line,s+a.index,r,a.raw);break}}))}}}));a(b);var y=n((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("The value of attribute "+r+" cannot use the ad keyword.",e.line,s+n.index,a,n.raw)}))}}}));a(y);var w=n((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=this,r={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."}},i=r.dash;if("object"==typeof a&&(i="mode"in a?r[a.mode]:a),"object"==typeof i&&i.regId){var s=i.regId,o=i.message;s instanceof RegExp||(s=new RegExp(s)),e.addListener("tagstart",(function(e){for(var a,r=e.attrs,i=e.col+e.tagName.length+1,l=0,u=r.length;l<u;l++)if("id"===(a=r[l]).name.toLowerCase()&&!1===s.test(a.value)&&t(o,e.line,i+a.index,n,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===s.test(c)&&t(o,e.line,i+a.index,n,c)}))}}}}));a(w);var L=n((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("The id value [ "+i+" ] must be unique.",e.line,o+r.index,a,r.raw));break}}))}}}));a(L);var O=n((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("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("Inline script [ "+n.raw+" ] cannot be used.",e.line,s+n.index,a,n.raw)}))}}}));a(O);var _=n((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("Inline style [ "+n.raw+" ] cannot be used.",e.line,i+n.index,a,n.raw)}))}}}));a(_);var j=n((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("No matching [ label ] tag found.",e.event.line,e.col,a,e.event.raw)}))}))}}}));a(j);var x=n((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("The <script> tag cannot be used.",e.line,e.col,a,e.raw)}))}}}));a(x);var P=n((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,r,i=this,s=null!==(n=null==a?void 0:a.mode)&&void 0!==n?n:"nomix",o="space"===(null==a?void 0:a.mode)?null!==(r=null==a?void 0:a.size)&&void 0!==r?r:4:null;"number"==typeof o&&(o<=0||o>8)&&(o=4),e.addListener("text",(function(a){for(var n,r=a.raw,l=/(^|\r?\n)([ \t]+)/g;n=l.exec(r);){var u=e.fixPos(a,n.index+n[1].length);if(1===u.col){var d=n[2];"space"===s?o?!1!==/^ +$/.test(d)&&d.length%o==0||t("Please use space for indentation and keep "+o+" length.",u.line,1,i,a.raw):!1===/^ +$/.test(d)&&t("Please use space for indentation.",u.line,1,i,a.raw):"tab"===s&&!1===/^\t+$/.test(d)?t("Please use tab for indentation.",u.line,1,i,a.raw):!0===/ +\t|\t+ /.test(d)&&t("Do not mix tabs and spaces for indentation.",u.line,1,i,a.raw)}}}))}}}));a(P);var T=n((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("Special characters must be escaped : [ "+r[0]+" ].",o.line,o.col,a,n.raw)}}))}}}));a(T);var M=n((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("The attribute [ "+n.name+" ] of the tag [ "+r+" ] must have a value.",e.line,s+n.index,a,n.raw)}))}}}));a(M);var N=n((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("The <style> tag cannot be used.",e.line,e.col,a,e.raw)}))}}}));a(N);var A=n((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("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("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("Tag must be paired, missing: [ "+r.join("")+" ], open tag match failed [ "+s.raw+" ] on line "+s.line+".",e.line,e.col,a,"")}}))}}}));a(A);var C=n((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("The empty tag : [ "+r+" ] must be self closed.",e.line,e.col,a,e.raw))}))}}}));a(C);var k=n((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,r=this,i=null!==(n=null==a?void 0:a.exceptions)&&void 0!==n?n:[];e.addListener("tagstart,tagend",(function(e){var a=e.tagName;-1===i.indexOf(a)&&a!==a.toLowerCase()&&t("The html element name of [ "+a+" ] must be in lowercase.",e.line,e.col,r,e.raw)}))}}}));a(k);var q=n((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("The html element name of [ "+r+" ] contains special character.",e.line,e.col,a,e.raw)}))}}}));a(q);var R=n((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("<title></title> must not be empty.",n.line,n.col,a,n.raw)}else"head"===o&&(!1===r&&t("<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)}}}));a(R);var E=n((function(e,a){var n=t&&t.__assign||function(){return(n=Object.assign||function(e){for(var t,a=1,n=arguments.length;a<n;a++)for(var r in t=arguments[a])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(a,"__esModule",{value:!0});var r={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"]}};a.default={id:"tags-check",description:"Checks html tags.",init:function(e,t,a){var i=this;r=n(n({},r),a),e.addListener("tagstart",(function(e){var a=e.attrs,n=e.col+e.tagName.length+1,s=e.tagName.toLowerCase();if(r[s]){var o=r[s];if(!0!==o.selfclosing||e.close?!1===o.selfclosing&&e.close&&t("The <"+s+"> tag must not be selfclosing.",e.line,e.col,i,e.raw):t("The <"+s+"> tag must be selfclosing.",e.line,e.col,i,e.raw),Array.isArray(o.attrsRequired))o.attrsRequired.forEach((function(r){if(Array.isArray(r)){var o=r.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("The <"+s+"> tag must have attr '"+l+"' with one value of '"+u.join("' or '")+"'.",e.line,n,i,e.raw)})):t("The <"+s+"> tag must have attr '"+l+"'.",e.line,n,i,e.raw)}else a.some((function(e){return-1!==r.split("|").indexOf(e.name)}))||t("The <"+s+"> tag must have attr '"+r+"'.",e.line,n,i,e.raw)}));if(Array.isArray(o.attrsOptional))o.attrsOptional.forEach((function(r){if(Array.isArray(r)){var o=r.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("The <"+s+"> tag must have optional attr '"+l+"' with one value of '"+u.join("' or '")+"'.",e.line,n,i,e.raw)}))}}));if(Array.isArray(o.redundantAttrs))o.redundantAttrs.forEach((function(r){a.some((function(e){return e.name===r}))&&t("The attr '"+r+"' is redundant for <"+s+"> and should be ommited.",e.line,n,i,e.raw)}))}}))}}}));a(E);var D=n((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,r=this,i=null!==(n=null==a?void 0:a.exceptions)&&void 0!==n?n:[];e.addListener("tagstart",(function(e){for(var a=e.attrs,n=e.col+e.tagName.length+1,s=0;s<a.length;s++)if(-1===i.indexOf(a[s].name)){var o=/(\s*)=(\s*)/.exec(a[s].raw.trim());!o||0===o[1].length&&0===o[2].length||t("The attribute '"+a[s].name+"' must not have spaces between the name and value.",e.line,n+a[s].index,r,a[s].raw)}}))}}}));a(D);var S=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"altRequire",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"attrLowercase",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"attrSort",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"attrNoDuplication",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"attrUnsafeChars",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"attrValueDoubleQuotes",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"attrValueNotEmpty",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"attrValueSingleQuotes",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"attrWhitespace",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(t,"doctypeFirst",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"doctypeHTML5",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(t,"headScriptDisabled",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(t,"hrefAbsOrRel",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(t,"idClsasAdDisabled",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"idClassValue",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(t,"idUnique",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(t,"inlineScriptDisabled",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(t,"inlineStyleDisabled",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(t,"inputRequiresLabel",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(t,"scriptDisabled",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(t,"spaceTabMixedDisabled",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(t,"specCharEscape",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(t,"srcNotEmpty",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(t,"styleDisabled",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(t,"tagPair",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(t,"tagSelfClose",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(t,"tagnameLowercase",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(t,"tagnameSpecialChars",{enumerable:!0,get:function(){return q.default}}),Object.defineProperty(t,"titleRequire",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(t,"tagsCheck",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(t,"attrNoUnnecessaryWhitespace",{enumerable:!0,get:function(){return D.default}})}));a(S);S.altRequire,S.attrLowercase,S.attrSort,S.attrNoDuplication,S.attrUnsafeChars,S.attrValueDoubleQuotes,S.attrValueNotEmpty,S.attrValueSingleQuotes,S.attrWhitespace,S.doctypeFirst,S.doctypeHTML5,S.headScriptDisabled,S.hrefAbsOrRel,S.idClsasAdDisabled,S.idClassValue,S.idUnique,S.inlineScriptDisabled,S.inlineStyleDisabled,S.inputRequiresLabel,S.scriptDisabled,S.spaceTabMixedDisabled,S.specCharEscape,S.srcNotEmpty,S.styleDisabled,S.tagPair,S.tagSelfClose,S.tagnameLowercase,S.tagnameSpecialChars,S.titleRequire,S.tagsCheck,S.attrNoUnnecessaryWhitespace;var H=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isRuleSeverity=void 0,t.isRuleSeverity=function(e){if("string"!=typeof e)return!1;switch(e){case"off":case"warn":case"error":return!0;default:return!1}}}));a(H);H.isRuleSeverity;var I=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLParser=t.Reporter=t.HTMLRules=t.HTMLHint=void 0,t.HTMLParser=r.default,t.Reporter=i.default,t.HTMLRules=S;var a=function(){function e(){this.rules={},this.defaultRuleset={"tagname-lowercase":"error","attr-lowercase":"error","attr-value-double-quotes":"error","doctype-first":"error","tag-pair":"error","spec-char-escape":"error","id-unique":"error","src-not-empty":"error","attr-no-duplication":"error","title-require":"error"}}return e.prototype.addRule=function(e){this.rules[e.id]=e},e.prototype.verify=function(e,t){void 0===t&&(t=this.defaultRuleset),0===Object.keys(t).length&&(t=this.defaultRuleset),e=e.replace(/^\s*<!--\s*htmlhint\s+([^\r\n]+?)\s*-->/i,(function(e,a){return a.replace(/(?:^|,)\s*([^:,]+)\s*(?:\:\s*([^,\s]+))?/g,(function(e,a,n){return t[a]=H.isRuleSeverity(n)?n:"error",""})),""}));var a,n=new r.default,s=new i.default(e,t),o=this.rules;for(var l in t){a=o[l];var u=t[l],d=Array.isArray(u)?u[0]:u;if(void 0!==a&&"off"!==d){var c=s[d].bind(s);a.init(n,c,Array.isArray(u)?u[1]:void 0)}}return n.parse(e),s.messages},e.prototype.format=function(e,t){void 0===t&&(t={});var a=[],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+="..."),a.push(r.white+n(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),a.push(r.white+n(i)+n(String(s).length+3+c)+"^ "+r.red+e.message+" ("+e.rule.id+")"+r.reset)})),a},e}();function n(e,t){return new Array(e+1).join(t||" ")}t.HTMLHint=new a,Object.keys(S).forEach((function(e){t.HTMLHint.addRule(S[e])}))})),$=a(I),z=I.HTMLParser,V=I.Reporter,F=I.HTMLRules,U=I.HTMLHint;e.HTMLHint=U,e.HTMLParser=z,e.HTMLRules=F,e.Reporter=V,e.default=$,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).HTMLHint=t()}(this,(function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t={},a={};Object.defineProperty(a,"__esModule",{value:!0});a.default=class{constructor(){this._listeners={},this._mapCdataTags=this.makeMap("script,style"),this._arrBlocks=[],this.lastEvent=null}makeMap(e){const t={},a=e.split(",");for(let e=0;e<a.length;e++)t[a[e]]=!0;return t}parse(e){const t=this._mapCdataTags,a=/<(?:\/([^\s>]+)\s*|!--([\s\S]*?)--|!([^>]*?)|([\w\-:]+)((?:\s+[^\s"'>\/=\x00-\x0F\x7F\x80-\x9F]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'>]*))?)*?)\s*(\/?))>/g,r=/\s*([^\s"'>\/=\x00-\x0F\x7F\x80-\x9F]+)(?:\s*=\s*(?:(")([^"]*)"|(')([^']*)'|([^\s"'>]*)))?/g,n=/\r?\n/g;let s,i,l,o,d,u,c=0,f=null,g=[],h=0,p=0,m=1;const b=this._arrBlocks;this.fire("start",{pos:0,line:1,col:1});const v=()=>{const e=o.find((e=>"type"===e.name))||{value:""};return t[l]&&-1===e.value.indexOf("text/ng-template")},y=(e,t,a,r)=>{const s=a-p+1;for(void 0===r&&(r={}),r.raw=t,r.pos=a,r.line=m,r.col=s,b.push(r),this.fire(e,r);n.exec(t);)m++,p=a+n.lastIndex};for(;s=a.exec(e);)if(i=s.index,i>c&&(u=e.substring(c,i),f?g.push(u):y("text",u,c)),c=a.lastIndex,!(l=s[1])||(f&&l===f&&(u=g.join(""),y("cdata",u,h,{tagName:f,attrs:d}),f=null,d=void 0,g=[]),f))if(f)g.push(s[0]);else if(l=s[4]){o=[];const e=s[5];let t,a=0;for(;t=r.exec(e);){const e=t[1],r=t[2]?t[2]:t[4]?t[4]:"",n=t[3]?t[3]:t[5]?t[5]:t[6]?t[6]:"";o.push({name:e,value:n,quote:r,index:t.index,raw:t[0]}),a+=t[0].length}a===e.length?(y("tagstart",s[0],i,{tagName:l,attrs:o,close:s[6]}),v()&&(f=l,d=o.concat(),g=[],h=c)):y("text",s[0],i)}else(s[2]||s[3])&&y("comment",s[0],i,{content:s[2]||s[3],long:!!s[2]});else y("tagend",s[0],i,{tagName:l});e.length>c&&(u=e.substring(c,e.length),y("text",u,c)),this.fire("end",{pos:c,line:m,col:e.length-p+1})}addListener(e,t){const a=this._listeners,r=e.split(/[,\s]/);let n;for(let e=0,s=r.length;e<s;e++)n=r[e],void 0===a[n]&&(a[n]=[]),a[n].push(t)}fire(e,t){void 0===t&&(t={}),t.type=e;let a=[];const r=this._listeners[e],n=this._listeners.all;void 0!==r&&(a=a.concat(r)),void 0!==n&&(a=a.concat(n));const s=this.lastEvent;null!==s&&(delete s.lastEvent,t.lastEvent=s),this.lastEvent=t;for(let e=0,r=a.length;e<r;e++)a[e].call(this,t)}removeListener(e,t){const a=this._listeners[e];if(void 0!==a)for(let e=0,r=a.length;e<r;e++)if(a[e]===t){a.splice(e,1);break}}fixPos(e,t){const a=e.raw.substr(0,t).split(/\r?\n/),r=a.length-1;let n,s=e.line;return r>0?(s+=r,n=a[r].length+1):n=e.col+t,{line:s,col:n}}getMapAttrs(e){const t={};let a;for(let r=0,n=e.length;r<n;r++)a=e[r],t[a.name]=a.value;return t}};var r={};Object.defineProperty(r,"__esModule",{value:!0});r.default=class{constructor(e,t){this.html=e,this.lines=e.split(/\r?\n/);const a=/\r?\n/.exec(e);this.brLen=null!==a?a[0].length:0,this.ruleset=t,this.messages=[]}info(e,t,a,r,n){this.report("info",e,t,a,r,n)}warn(e,t,a,r,n){this.report("warning",e,t,a,r,n)}error(e,t,a,r,n){this.report("error",e,t,a,r,n)}report(e,t,a,r,n,s){const i=this.lines,l=this.brLen;let o="",d=0;for(let e=a-1,t=i.length;e<t&&(o=i[e],d=o.length,r>d&&a<t);e++)a++,1!==(r-=d)&&(r-=l);this.messages.push({type:e,message:t,raw:s,evidence:o,line:a,col:r,rule:{id:n.id,description:n.description,link:`https://github.com/thedaviddias/HTMLHint/wiki/${n.id}`}})}};var n={},s={};Object.defineProperty(s,"__esModule",{value:!0}),s.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(e,t){e.addListener("tagstart",(a=>{const r=a.tagName.toLowerCase(),n=e.getMapAttrs(a.attrs),s=a.col+r.length+1;let i;"img"!==r||"alt"in n?("area"===r&&"href"in n||"input"===r&&"image"===n.type)&&("alt"in n&&""!==n.alt||(i="area"===r?"area[href]":"input[type=image]",t.warn(`The alt attribute of ${i} must have a value.`,a.line,s,this,a.raw))):t.warn("An alt attribute must be present on <img> elements.",a.line,s,this,a.raw)}))}};var i={};function l(e,t){if(t instanceof RegExp)return!!t.test(e)&&{match:e,pattern:t};const a=t[0],r=t[t.length-1],n=t[t.length-2],s="/"===a&&("/"===r||"/"===n&&"i"===r);if(s){return s&&"i"===r?new RegExp(t.slice(1,-2),"i").test(e):new RegExp(t.slice(1,-1)).test(e)}return e===t}Object.defineProperty(i,"__esModule",{value:!0}),i.default={id:"attr-lowercase",description:"All attribute names must be in lowercase.",init(e,t,a){const r=Array.isArray(a)?a:[];e.addListener("tagstart",(e=>{const a=e.attrs;let n;const s=e.col+e.tagName.length+1;for(let i=0,o=a.length;i<o;i++){n=a[i];const o=n.name;r.find((e=>l(o,e)))||o===o.toLowerCase()||t.error(`The attribute name of [ ${o} ] must be in lowercase.`,e.line,s+n.index,this,n.raw)}}))}};var o={};Object.defineProperty(o,"__esModule",{value:!0}),o.default={id:"attr-sorted",description:"Attribute tags must be in proper order.",init(e,t){const a={},r=["class","id","name","src","for","type","href","value","title","alt","role"];for(let e=0;e<r.length;e++)a[r[e]]=e;e.addListener("tagstart",(e=>{const r=e.attrs,n=[];for(let e=0;e<r.length;e++)n.push(r[e].name);const s=JSON.stringify(n);n.sort(((e,t)=>null==a[e]&&null==a[t]?0:null==a[e]?1:null==a[t]?-1:a[e]-a[t]||e.localeCompare(t))),s!==JSON.stringify(n)&&t.error(`Inaccurate order ${s} should be in hierarchy ${JSON.stringify(n)} `,e.line,e.col,this,e.raw)}))}};var d={};Object.defineProperty(d,"__esModule",{value:!0}),d.default={id:"attr-no-duplication",description:"Elements cannot have duplicate attributes.",init(e,t){e.addListener("tagstart",(e=>{const a=e.attrs;let r,n;const s=e.col+e.tagName.length+1,i={};for(let l=0,o=a.length;l<o;l++)r=a[l],n=r.name,!0===i[n]&&t.error(`Duplicate of attribute name [ ${r.name} ] was found.`,e.line,s+r.index,this,r.raw),i[n]=!0}))}};var u={};Object.defineProperty(u,"__esModule",{value:!0}),u.default={id:"attr-unsafe-chars",description:"Attribute values cannot contain unsafe chars.",init(e,t){e.addListener("tagstart",(e=>{const a=e.attrs;let r;const n=e.col+e.tagName.length+1,s=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/;let i;for(let l=0,o=a.length;l<o;l++)if(r=a[l],i=s.exec(r.value),null!==i){const a=escape(i[0]).replace(/%u/,"\\u").replace(/%/,"\\x");t.warn(`The value of attribute [ ${r.name} ] cannot contain an unsafe char [ ${a} ].`,e.line,n+r.index,this,r.raw)}}))}};var c={};Object.defineProperty(c,"__esModule",{value:!0}),c.default={id:"attr-value-double-quotes",description:"Attribute values must be in double quotes.",init(e,t){e.addListener("tagstart",(e=>{const a=e.attrs;let r;const n=e.col+e.tagName.length+1;for(let s=0,i=a.length;s<i;s++)r=a[s],(""!==r.value&&'"'!==r.quote||""===r.value&&"'"===r.quote)&&t.error(`The value of attribute [ ${r.name} ] must be in double quotes.`,e.line,n+r.index,this,r.raw)}))}};var f={};Object.defineProperty(f,"__esModule",{value:!0}),f.default={id:"attr-value-not-empty",description:"All attributes must have values.",init(e,t){e.addListener("tagstart",(e=>{const a=e.attrs;let r;const n=e.col+e.tagName.length+1;for(let s=0,i=a.length;s<i;s++)r=a[s],""===r.quote&&""===r.value&&t.warn(`The attribute [ ${r.name} ] must have a value.`,e.line,n+r.index,this,r.raw)}))}};var g={};Object.defineProperty(g,"__esModule",{value:!0}),g.default={id:"attr-value-single-quotes",description:"Attribute values must be in single quotes.",init(e,t){e.addListener("tagstart",(e=>{const a=e.attrs;let r;const n=e.col+e.tagName.length+1;for(let s=0,i=a.length;s<i;s++)r=a[s],(""!==r.value&&"'"!==r.quote||""===r.value&&'"'===r.quote)&&t.error(`The value of attribute [ ${r.name} ] must be in single quotes.`,e.line,n+r.index,this,r.raw)}))}};var h={};Object.defineProperty(h,"__esModule",{value:!0}),h.default={id:"attr-whitespace",description:"All attributes should be separated by only one space and not have leading/trailing whitespace.",init(e,t,a){const r=Array.isArray(a)?a:[];e.addListener("tagstart",(e=>{const a=e.attrs;let n;const s=e.col+e.tagName.length+1;a.forEach((a=>{n=a;const i=a.name;-1===r.indexOf(i)&&(a.value.trim()!==a.value&&t.error(`The attributes of [ ${i} ] must not have trailing whitespace.`,e.line,s+n.index,this,n.raw),a.value.replace(/ +(?= )/g,"")!==a.value&&t.error(`The attributes of [ ${i} ] must be separated by only one space.`,e.line,s+n.index,this,n.raw))}))}))}};var p={};Object.defineProperty(p,"__esModule",{value:!0}),p.default={id:"doctype-first",description:"Doctype must be declared first.",init(e,t){const a=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,this,r.raw),e.removeListener("all",a))};e.addListener("all",a)}};var m={};Object.defineProperty(m,"__esModule",{value:!0}),m.default={id:"doctype-html5",description:'Invalid doctype. Use: "<!DOCTYPE html>"',init(e,t){const a=e=>{!1===e.long&&"doctype html"!==e.content.toLowerCase()&&t.warn('Invalid doctype. Use: "<!DOCTYPE html>"',e.line,e.col,this,e.raw)},r=()=>{e.removeListener("comment",a),e.removeListener("tagstart",r)};e.addListener("all",a),e.addListener("tagstart",r)}};var b={};Object.defineProperty(b,"__esModule",{value:!0}),b.default={id:"head-script-disabled",description:"The <script> tag cannot be used in a <head> tag.",init(e,t){const a=/^(text\/javascript|application\/javascript)$/i;let r=!1;const n=n=>{const s=e.getMapAttrs(n.attrs).type,i=n.tagName.toLowerCase();"head"===i&&(r=!0),!0!==r||"script"!==i||s&&!0!==a.test(s)||t.warn("The <script> tag cannot be used in a <head> tag.",n.line,n.col,this,n.raw)},s=t=>{"head"===t.tagName.toLowerCase()&&(e.removeListener("tagstart",n),e.removeListener("tagend",s))};e.addListener("tagstart",n),e.addListener("tagend",s)}};var v={};Object.defineProperty(v,"__esModule",{value:!0}),v.default={id:"href-abs-or-rel",description:"An href attribute must be either absolute or relative.",init(e,t,a){const r="abs"===a?"absolute":"relative";e.addListener("tagstart",(e=>{const a=e.attrs;let n;const s=e.col+e.tagName.length+1;for(let i=0,l=a.length;i<l;i++)if(n=a[i],"href"===n.name){("absolute"===r&&!1===/^\w+?:/.test(n.value)||"relative"===r&&!0===/^https?:\/\//.test(n.value))&&t.warn(`The value of the href attribute [ ${n.value} ] must be ${r}.`,e.line,s+n.index,this,n.raw);break}}))}};var y={};Object.defineProperty(y,"__esModule",{value:!0});y.default={id:"html-lang-require",description:"The lang attribute of an <html> element must be present and should be valid.",init(e,t){e.addListener("tagstart",(a=>{const r=a.tagName.toLowerCase(),n=e.getMapAttrs(a.attrs),s=a.col+r.length+1,i=new RegExp("((?<grandfathered>(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?<language>([A-Za-z]{2,3}(-(?<extlang>[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-(?<script>[A-Za-z]{4}))?(-(?<region>[A-Za-z]{2}|[0-9]{3}))?(-(?<variant>[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?<extension>[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?<privateUse>x(-[A-Za-z0-9]{1,8})+))?)|(?<privateUse2>x(-[A-Za-z0-9]{1,8})+))","g");"html"===r&&("lang"in n?n.lang?i.test(n.lang)||t.warn("The lang attribute value of <html> element must be a valid BCP47.",a.line,s,this,a.raw):t.warn("The lang attribute of <html> element must have a value.",a.line,s,this,a.raw):t.warn("An lang attribute must be present on <html> elements.",a.line,s,this,a.raw))}))}};var w={};Object.defineProperty(w,"__esModule",{value:!0}),w.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(e,t){e.addListener("tagstart",(e=>{const a=e.attrs;let r,n;const s=e.col+e.tagName.length+1;for(let i=0,l=a.length;i<l;i++)r=a[i],n=r.name,/^(id|class)$/i.test(n)&&/(^|[-_])ad([-_]|$)/i.test(r.value)&&t.warn(`The value of attribute ${n} cannot use the ad keyword.`,e.line,s+r.index,this,r.raw)}))}};var O={};Object.defineProperty(O,"__esModule",{value:!0}),O.default={id:"id-class-value",description:"The id and class attribute values must meet the specified rules.",init(e,t,a){let r;if(r="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,"object"==typeof r&&r.regId){let a=r.regId;const n=r.message;a instanceof RegExp||(a=new RegExp(a)),e.addListener("tagstart",(e=>{const r=e.attrs;let s;const i=e.col+e.tagName.length+1;for(let l=0,o=r.length;l<o;l++)if(s=r[l],"id"===s.name.toLowerCase()&&!1===a.test(s.value)&&t.warn(n,e.line,i+s.index,this,s.raw),"class"===s.name.toLowerCase()){const r=s.value.split(/\s+/g);let l;for(let o=0,d=r.length;o<d;o++)l=r[o],l&&!1===a.test(l)&&t.warn(n,e.line,i+s.index,this,l)}}))}}};var L={};Object.defineProperty(L,"__esModule",{value:!0}),L.default={id:"id-unique",description:"The value of id attributes must be unique.",init(e,t){const a={};e.addListener("tagstart",(e=>{const r=e.attrs;let n,s;const i=e.col+e.tagName.length+1;for(let l=0,o=r.length;l<o;l++)if(n=r[l],"id"===n.name.toLowerCase()){s=n.value,s&&(void 0===a[s]?a[s]=1:a[s]++,a[s]>1&&t.error(`The id value [ ${s} ] must be unique.`,e.line,i+n.index,this,n.raw));break}}))}};var x={};Object.defineProperty(x,"__esModule",{value:!0}),x.default={id:"inline-script-disabled",description:"Inline script cannot be used.",init(e,t){e.addListener("tagstart",(e=>{const a=e.attrs;let r;const n=e.col+e.tagName.length+1;let s;const i=/^on(unload|message|submit|select|scroll|resize|mouseover|mouseout|mousemove|mouseleave|mouseenter|mousedown|load|keyup|keypress|keydown|focus|dblclick|click|change|blur|error)$/i;for(let l=0,o=a.length;l<o;l++)r=a[l],s=r.name.toLowerCase(),!0===i.test(s)?t.warn(`Inline script [ ${r.raw} ] cannot be used.`,e.line,n+r.index,this,r.raw):"src"!==s&&"href"!==s||/^\s*javascript:/i.test(r.value)&&t.warn(`Inline script [ ${r.raw} ] cannot be used.`,e.line,n+r.index,this,r.raw)}))}};var j={};Object.defineProperty(j,"__esModule",{value:!0}),j.default={id:"inline-style-disabled",description:"Inline style cannot be used.",init(e,t){e.addListener("tagstart",(e=>{const a=e.attrs;let r;const n=e.col+e.tagName.length+1;for(let s=0,i=a.length;s<i;s++)r=a[s],"style"===r.name.toLowerCase()&&t.warn(`Inline style [ ${r.raw} ] cannot be used.`,e.line,n+r.index,this,r.raw)}))}};var _={};Object.defineProperty(_,"__esModule",{value:!0}),_.default={id:"input-requires-label",description:"All [ input ] tags must have a corresponding [ label ] tag. ",init(e,t){const a=[],r=[];e.addListener("tagstart",(t=>{const n=t.tagName.toLowerCase(),s=e.getMapAttrs(t.attrs),i=t.col+n.length+1;"input"===n&&r.push({event:t,col:i,id:s.id}),"label"===n&&"for"in s&&""!==s.for&&a.push({event:t,col:i,forValue:s.for})})),e.addListener("end",(()=>{r.forEach((e=>{(function(e){let t=!1;return a.forEach((a=>{e.id&&e.id===a.forValue&&(t=!0)})),t})(e)||t.warn("No matching [ label ] tag found.",e.event.line,e.col,this,e.event.raw)}))}))}};var P={};Object.defineProperty(P,"__esModule",{value:!0}),P.default={id:"script-disabled",description:"The <script> tag cannot be used.",init(e,t){e.addListener("tagstart",(e=>{"script"===e.tagName.toLowerCase()&&t.error("The <script> tag cannot be used.",e.line,e.col,this,e.raw)}))}};var $={};Object.defineProperty($,"__esModule",{value:!0}),$.default={id:"space-tab-mixed-disabled",description:"Do not mix tabs and spaces for indentation.",init(e,t,a){let r="nomix",n=null;if("string"==typeof a){const e=/^([a-z]+)(\d+)?/.exec(a);e&&(r=e[1],n=e[2]&&parseInt(e[2],10))}e.addListener("text",(a=>{const s=a.raw,i=/(^|\r?\n)([ \t]+)/g;let l;for(;l=i.exec(s);){const s=e.fixPos(a,l.index+l[1].length);if(1!==s.col)continue;const i=l[2];"space"===r?n?!1!==/^ +$/.test(i)&&i.length%n==0||t.warn(`Please use space for indentation and keep ${n} length.`,s.line,1,this,a.raw):!1===/^ +$/.test(i)&&t.warn("Please use space for indentation.",s.line,1,this,a.raw):"tab"===r&&!1===/^\t+$/.test(i)?t.warn("Please use tab for indentation.",s.line,1,this,a.raw):!0===/ +\t|\t+ /.test(i)&&t.warn("Do not mix tabs and spaces for indentation.",s.line,1,this,a.raw)}}))}};var T={};Object.defineProperty(T,"__esModule",{value:!0}),T.default={id:"spec-char-escape",description:"Special characters must be escaped.",init(e,t){e.addListener("text",(a=>{const r=a.raw,n=/([<>])|( \& )/g;let s;for(;s=n.exec(r);){const r=e.fixPos(a,s.index);t.error(`Special characters must be escaped : [ ${s[0]} ].`,r.line,r.col,this,a.raw)}}))}};var A={};Object.defineProperty(A,"__esModule",{value:!0}),A.default={id:"src-not-empty",description:"The src attribute of an img(script,link) must have a value.",init(e,t){e.addListener("tagstart",(e=>{const a=e.tagName,r=e.attrs;let n;const s=e.col+a.length+1;for(let i=0,l=r.length;i<l;i++)n=r[i],(!0===/^(img|script|embed|bgsound|iframe)$/.test(a)&&"src"===n.name||"link"===a&&"href"===n.name||"object"===a&&"data"===n.name)&&""===n.value&&t.error(`The attribute [ ${n.name} ] of the tag [ ${a} ] must have a value.`,e.line,s+n.index,this,n.raw)}))}};var M={};Object.defineProperty(M,"__esModule",{value:!0}),M.default={id:"style-disabled",description:"<style> tags cannot be used.",init(e,t){e.addListener("tagstart",(e=>{"style"===e.tagName.toLowerCase()&&t.warn("The <style> tag cannot be used.",e.line,e.col,this,e.raw)}))}};var N={};Object.defineProperty(N,"__esModule",{value:!0}),N.default={id:"tag-pair",description:"Tag must be paired.",init(e,t){const a=[],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",(e=>{const t=e.tagName.toLowerCase();void 0!==r[t]||e.close||a.push({tagName:t,line:e.line,raw:e.raw})})),e.addListener("tagend",(e=>{const r=e.tagName.toLowerCase();let n;for(n=a.length-1;n>=0&&a[n].tagName!==r;n--);if(n>=0){const r=[];for(let e=a.length-1;e>n;e--)r.push(`</${a[e].tagName}>`);if(r.length>0){const n=a[a.length-1];t.error(`Tag must be paired, missing: [ ${r.join("")} ], start tag match failed [ ${n.raw} ] on line ${n.line}.`,e.line,e.col,this,e.raw)}a.length=n}else t.error(`Tag must be paired, no start tag: [ ${e.raw} ]`,e.line,e.col,this,e.raw)})),e.addListener("end",(e=>{const r=[];for(let e=a.length-1;e>=0;e--)r.push(`</${a[e].tagName}>`);if(r.length>0){const n=a[a.length-1];t.error(`Tag must be paired, missing: [ ${r.join("")} ], open tag match failed [ ${n.raw} ] on line ${n.line}.`,e.line,e.col,this,"")}}))}};var C={};Object.defineProperty(C,"__esModule",{value:!0}),C.default={id:"tag-self-close",description:"Empty tags must be self closed.",init(e,t){const a=e.makeMap("area,base,basefont,bgsound,br,col,frame,hr,img,input,isindex,link,meta,param,embed,track,command,source,keygen,wbr");e.addListener("tagstart",(e=>{const r=e.tagName.toLowerCase();void 0!==a[r]&&(e.close||t.warn(`The empty tag : [ ${r} ] must be self closed.`,e.line,e.col,this,e.raw))}))}};var k={};Object.defineProperty(k,"__esModule",{value:!0}),k.default={id:"empty-tag-not-self-closed",description:"Empty tags must not use self closed syntax.",init(e,t){const a=e.makeMap("area,base,basefont,bgsound,br,col,frame,hr,img,input,isindex,link,meta,param,embed,track,command,source,keygen,wbr");e.addListener("tagstart",(e=>{const r=e.tagName.toLowerCase();void 0!==a[r]&&e.close&&t.error(`The empty tag : [ ${r} ] must not use self closed syntax.`,e.line,e.col,this,e.raw)}))}};var E={};Object.defineProperty(E,"__esModule",{value:!0}),E.default={id:"tagname-lowercase",description:"All html element names must be in lowercase.",init(e,t,a){const r=Array.isArray(a)?a:[];e.addListener("tagstart,tagend",(e=>{const 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,this,e.raw)}))}};var q={};Object.defineProperty(q,"__esModule",{value:!0}),q.default={id:"tagname-specialchars",description:"All special characters must be escaped.",init(e,t){const a=/[^a-zA-Z0-9\-:_]/;e.addListener("tagstart,tagend",(e=>{const r=e.tagName;a.test(r)&&t.error(`The html element name of [ ${r} ] contains special character.`,e.line,e.col,this,e.raw)}))}};var R={};Object.defineProperty(R,"__esModule",{value:!0}),R.default={id:"title-require",description:"<title> must be present in <head> tag.",init(e,t){let a=!1,r=!1;const n=e=>{const t=e.tagName.toLowerCase();"head"===t?a=!0:"title"===t&&a&&(r=!0)},s=a=>{const i=a.tagName.toLowerCase();if(r&&"title"===i){const e=a.lastEvent;("text"!==e.type||"text"===e.type&&!0===/^\s*$/.test(e.raw))&&t.error("<title></title> must not be empty.",a.line,a.col,this,a.raw)}else"head"===i&&(!1===r&&t.error("<title> must be present in <head> tag.",a.line,a.col,this,a.raw),e.removeListener("tagstart",n),e.removeListener("tagend",s))};e.addListener("tagstart",n),e.addListener("tagend",s)}};var z={};Object.defineProperty(z,"__esModule",{value:!0});let D={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"]}};z.default={id:"tags-check",description:"Checks html tags.",init(e,t,a){D=Object.assign(Object.assign({},D),a),e.addListener("tagstart",(e=>{const a=e.attrs,r=e.col+e.tagName.length+1,n=e.tagName.toLowerCase();if(D[n]){const s=D[n];if(!0!==s.selfclosing||e.close?!1===s.selfclosing&&e.close&&t.warn(`The <${n}> tag must not be selfclosing.`,e.line,e.col,this,e.raw):t.warn(`The <${n}> tag must be selfclosing.`,e.line,e.col,this,e.raw),Array.isArray(s.attrsRequired)){s.attrsRequired.forEach((s=>{if(Array.isArray(s)){const i=s.map((e=>e)),l=i.shift(),o=i;a.some((e=>e.name===l))?a.forEach((a=>{a.name===l&&-1===o.indexOf(a.value)&&t.error(`The <${n}> tag must have attr '${l}' with one value of '${o.join("' or '")}'.`,e.line,r,this,e.raw)})):t.error(`The <${n}> tag must have attr '${l}'.`,e.line,r,this,e.raw)}else a.some((e=>-1!==s.split("|").indexOf(e.name)))||t.error(`The <${n}> tag must have attr '${s}'.`,e.line,r,this,e.raw)}))}if(Array.isArray(s.attrsOptional)){s.attrsOptional.forEach((s=>{if(Array.isArray(s)){const i=s.map((e=>e)),l=i.shift(),o=i;a.some((e=>e.name===l))&&a.forEach((a=>{a.name===l&&-1===o.indexOf(a.value)&&t.error(`The <${n}> tag must have optional attr '${l}' with one value of '${o.join("' or '")}'.`,e.line,r,this,e.raw)}))}}))}if(Array.isArray(s.redundantAttrs)){s.redundantAttrs.forEach((s=>{a.some((e=>e.name===s))&&t.error(`The attr '${s}' is redundant for <${n}> and should be omitted.`,e.line,r,this,e.raw)}))}}}))}};var S={};return Object.defineProperty(S,"__esModule",{value:!0}),S.default={id:"attr-no-unnecessary-whitespace",description:"No spaces between attribute names and values.",init(e,t,a){const r=Array.isArray(a)?a:[];e.addListener("tagstart",(e=>{const a=e.attrs,n=e.col+e.tagName.length+1;for(let s=0;s<a.length;s++)if(-1===r.indexOf(a[s].name)){const r=/(\s*)=(\s*)/.exec(a[s].raw.trim());!r||0===r[1].length&&0===r[2].length||t.error(`The attribute '${a[s].name}' must not have spaces between the name and value.`,e.line,n+a[s].index,this,a[s].raw)}}))}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.attrNoUnnecessaryWhitespace=e.tagsCheck=e.titleRequire=e.tagnameSpecialChars=e.tagnameLowercase=e.emptyTagNotSelfClosed=e.tagSelfClose=e.tagPair=e.styleDisabled=e.srcNotEmpty=e.specCharEscape=e.spaceTabMixedDisabled=e.scriptDisabled=e.inputRequiresLabel=e.inlineStyleDisabled=e.inlineScriptDisabled=e.idUnique=e.idClassValue=e.idClsasAdDisabled=e.htmlLangRequire=e.hrefAbsOrRel=e.headScriptDisabled=e.doctypeHTML5=e.doctypeFirst=e.attrWhitespace=e.attrValueSingleQuotes=e.attrValueNotEmpty=e.attrValueDoubleQuotes=e.attrUnsafeChars=e.attrNoDuplication=e.attrSort=e.attrLowercase=e.altRequire=void 0;var t=s;Object.defineProperty(e,"altRequire",{enumerable:!0,get:function(){return t.default}});var a=i;Object.defineProperty(e,"attrLowercase",{enumerable:!0,get:function(){return a.default}});var r=o;Object.defineProperty(e,"attrSort",{enumerable:!0,get:function(){return r.default}});var n=d;Object.defineProperty(e,"attrNoDuplication",{enumerable:!0,get:function(){return n.default}});var l=u;Object.defineProperty(e,"attrUnsafeChars",{enumerable:!0,get:function(){return l.default}});var D=c;Object.defineProperty(e,"attrValueDoubleQuotes",{enumerable:!0,get:function(){return D.default}});var H=f;Object.defineProperty(e,"attrValueNotEmpty",{enumerable:!0,get:function(){return H.default}});var Z=g;Object.defineProperty(e,"attrValueSingleQuotes",{enumerable:!0,get:function(){return Z.default}});var I=h;Object.defineProperty(e,"attrWhitespace",{enumerable:!0,get:function(){return I.default}});var U=p;Object.defineProperty(e,"doctypeFirst",{enumerable:!0,get:function(){return U.default}});var V=m;Object.defineProperty(e,"doctypeHTML5",{enumerable:!0,get:function(){return V.default}});var F=b;Object.defineProperty(e,"headScriptDisabled",{enumerable:!0,get:function(){return F.default}});var B=v;Object.defineProperty(e,"hrefAbsOrRel",{enumerable:!0,get:function(){return B.default}});var W=y;Object.defineProperty(e,"htmlLangRequire",{enumerable:!0,get:function(){return W.default}});var J=w;Object.defineProperty(e,"idClsasAdDisabled",{enumerable:!0,get:function(){return J.default}});var Q=O;Object.defineProperty(e,"idClassValue",{enumerable:!0,get:function(){return Q.default}});var Y=L;Object.defineProperty(e,"idUnique",{enumerable:!0,get:function(){return Y.default}});var G=x;Object.defineProperty(e,"inlineScriptDisabled",{enumerable:!0,get:function(){return G.default}});var K=j;Object.defineProperty(e,"inlineStyleDisabled",{enumerable:!0,get:function(){return K.default}});var X=_;Object.defineProperty(e,"inputRequiresLabel",{enumerable:!0,get:function(){return X.default}});var ee=P;Object.defineProperty(e,"scriptDisabled",{enumerable:!0,get:function(){return ee.default}});var te=$;Object.defineProperty(e,"spaceTabMixedDisabled",{enumerable:!0,get:function(){return te.default}});var ae=T;Object.defineProperty(e,"specCharEscape",{enumerable:!0,get:function(){return ae.default}});var re=A;Object.defineProperty(e,"srcNotEmpty",{enumerable:!0,get:function(){return re.default}});var ne=M;Object.defineProperty(e,"styleDisabled",{enumerable:!0,get:function(){return ne.default}});var se=N;Object.defineProperty(e,"tagPair",{enumerable:!0,get:function(){return se.default}});var ie=C;Object.defineProperty(e,"tagSelfClose",{enumerable:!0,get:function(){return ie.default}});var le=k;Object.defineProperty(e,"emptyTagNotSelfClosed",{enumerable:!0,get:function(){return le.default}});var oe=E;Object.defineProperty(e,"tagnameLowercase",{enumerable:!0,get:function(){return oe.default}});var de=q;Object.defineProperty(e,"tagnameSpecialChars",{enumerable:!0,get:function(){return de.default}});var ue=R;Object.defineProperty(e,"titleRequire",{enumerable:!0,get:function(){return ue.default}});var ce=z;Object.defineProperty(e,"tagsCheck",{enumerable:!0,get:function(){return ce.default}});var fe=S;Object.defineProperty(e,"attrNoUnnecessaryWhitespace",{enumerable:!0,get:function(){return fe.default}})}(n),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.HTMLParser=e.Reporter=e.HTMLRules=e.HTMLHint=void 0;const t=a;e.HTMLParser=t.default;const s=r;e.Reporter=s.default;const i=n;e.HTMLRules=i;function l(e,t){return new Array(e+1).join(t||" ")}e.HTMLHint=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,a=this.defaultRuleset){0===Object.keys(a).length&&(a=this.defaultRuleset),e=e.replace(/^\s*<!--\s*htmlhint\s+([^\r\n]+?)\s*-->/i,((e,t)=>(t.replace(/(?:^|,)\s*([^:,]+)\s*(?:\:\s*([^,\s]+))?/g,((e,t,r)=>(a[t]=!(void 0!==r&&r.length>0)||JSON.parse(r),""))),"")));const r=new t.default,n=new s.default(e,a),i=this.rules;let l;for(const e in a)l=i[e],void 0!==l&&!1!==a[e]&&l.init(r,n,a[e]);return r.parse(e),n.messages}format(e,t={}){const a=[],r={white:"",grey:"",red:"",reset:""};t.colors&&(r.white="[37m",r.grey="[90m",r.red="[31m",r.reset="[39m");const n=t.indent||0;return e.forEach((e=>{let t=e.evidence;const s=e.line,i=e.col,o=t.length;let d=i>41?i-40:1,u=t.length>i+60?i+60:o;i<41&&(u+=40-i+1),t=t.replace(/\t/g," ").substring(d-1,u),d>1&&(t=`...${t}`,d-=3),u<o&&(t+="..."),a.push(`${r.white+l(n)}L${s} |${r.grey}${t}${r.reset}`);let c=i-d;const f=t.substring(0,c).match(/[^\u0000-\u00ff]/g);null!==f&&(c+=f.length),a.push(`${r.white+l(n)+l(String(s).length+3+c)}^ ${r.red}${e.message} (${e.rule.id})${r.reset}`)})),a}},Object.keys(i).forEach((t=>{e.HTMLHint.addRule(i[t])}))}(t),e(t)})); |
165
package.json
{ | ||
"name": "htmlhint", | ||
"version": "1.0.0-beta.1", | ||
"version": "1.0.0", | ||
"description": "The Static Code Analysis Tool for your HTML", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/htmlhint/HTMLHint.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/htmlhint/HTMLHint/issues" | ||
}, | ||
"keywords": [ | ||
@@ -19,33 +12,39 @@ "html", | ||
"homepage": "https://htmlhint.com", | ||
"bugs": { | ||
"url": "https://github.com/htmlhint/HTMLHint/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/htmlhint/HTMLHint.git" | ||
}, | ||
"license": "MIT", | ||
"main": "dist/htmlhint.js", | ||
"module": "dist/core/core.js", | ||
"bin": { | ||
"htmlhint": "./bin/htmlhint" | ||
}, | ||
"main": "dist/htmlhint.js", | ||
"module": "dist/core/core.js", | ||
"files": [ | ||
"bin", | ||
"dist" | ||
], | ||
"scripts": { | ||
"build": "npm run clean && tsc && npm run build:rollup", | ||
"build:min": "rollup -c --environment NODE_ENV:production --file dist/htmlhint.min.js", | ||
"build:rollup": "npm run build:min && npm run build:unmin", | ||
"build:unmin": "rollup -c", | ||
"clean": "rimraf dist", | ||
"commit": "npx git-cz", | ||
"lint": "prettier -c . && eslint . --ext .js,.ts --max-warnings 0", | ||
"lint:fix": "npm run prettier && npm run lint -- --fix", | ||
"prepare": "husky install", | ||
"prettier": "prettier --write .", | ||
"test": "mocha --recursive \"./test/**/*.spec.js\"", | ||
"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": "eslint . --ext .js,.ts --max-warnings 0", | ||
"lint:fix": "eslint --fix . --ext .js,.ts --max-warnings 0", | ||
"test:coverage": "nyc npm run test" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"prepare-commit-msg": "exec < /dev/tty && git cz --hook || true", | ||
"pre-commit": "lint-staged" | ||
} | ||
}, | ||
"lint-staged": { | ||
"*.(js|md)": [ | ||
"npm run prettier" | ||
"*": [ | ||
"prettier --ignore-unknown --write" | ||
], | ||
".js": [ | ||
"npm run lint:fix", | ||
"npm run lint" | ||
"eslint --fix" | ||
] | ||
@@ -61,67 +60,4 @@ }, | ||
}, | ||
"dependencies": { | ||
"async": "3.2.0", | ||
"chalk": "4.0.0", | ||
"commander": "5.1.0", | ||
"glob": "7.1.6", | ||
"parse-glob": "3.0.4", | ||
"request": "2.88.2", | ||
"strip-json-comments": "3.1.0", | ||
"xml": "1.0.1" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/cli": "8.3.5", | ||
"@commitlint/config-conventional": "8.3.4", | ||
"@rollup/plugin-commonjs": "12.0.0", | ||
"@rollup/plugin-node-resolve": "8.0.0", | ||
"@semantic-release/changelog": "5.0.1", | ||
"@semantic-release/commit-analyzer": "8.0.1", | ||
"@semantic-release/git": "9.0.0", | ||
"@semantic-release/github": "7.0.7", | ||
"@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.2", | ||
"@typescript-eslint/parser": "3.0.2", | ||
"commitizen": "4.1.2", | ||
"commitlint": "8.3.5", | ||
"eslint": "7.1.0", | ||
"eslint-config-prettier": "6.11.0", | ||
"eslint-plugin-prettier": "3.1.3", | ||
"expect.js": "0.3.1", | ||
"husky": "4.2.5", | ||
"lint-staged": "10.2.7", | ||
"mocha": "7.2.0", | ||
"nyc": "15.1.0", | ||
"prettier": "2.0.5", | ||
"pretty-quick": "2.0.1", | ||
"rollup": "2.12.0", | ||
"rollup-plugin-babel": "4.4.0", | ||
"rollup-plugin-terser": "6.1.0", | ||
"semantic-release": "17.0.8", | ||
"typescript": "3.9.3" | ||
}, | ||
"release": { | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/changelog", | ||
"@semantic-release/npm", | ||
"@semantic-release/github", | ||
"@semantic-release/git" | ||
] | ||
}, | ||
"files": [ | ||
"bin", | ||
"dist" | ||
], | ||
"nyc": { | ||
"all": true, | ||
"include": [ | ||
"dist/htmlhint.js" | ||
], | ||
"exclude": [ | ||
@@ -132,8 +68,55 @@ "**/*.spec.js", | ||
], | ||
"include": [ | ||
"dist/htmlhint.js" | ||
], | ||
"reporter": [ | ||
"text", | ||
"lcov" | ||
"json" | ||
], | ||
"sourceMap": false | ||
}, | ||
"dependencies": { | ||
"async": "3.2.2", | ||
"chalk": "^4.1.2", | ||
"commander": "^8.3.0", | ||
"glob": "^7.2.0", | ||
"node-fetch": "^2.6.2", | ||
"parse-glob": "3.0.4", | ||
"strip-json-comments": "3.1.0", | ||
"xml": "1.0.1" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/cli": "^15.0.0", | ||
"@commitlint/config-conventional": "^15.0.0", | ||
"@rollup/plugin-commonjs": "^21.0.1", | ||
"@rollup/plugin-node-resolve": "^13.0.6", | ||
"@semantic-release/changelog": "^6.0.1", | ||
"@semantic-release/commit-analyzer": "^9.0.2", | ||
"@semantic-release/git": "^10.0.1", | ||
"@semantic-release/github": "^8.0.2", | ||
"@semantic-release/npm": "^8.0.3", | ||
"@semantic-release/release-notes-generator": "^10.0.2", | ||
"@types/async": "^3.2.10", | ||
"@types/glob": "^7.2.0", | ||
"@types/node-fetch": "^2.5.12", | ||
"@types/parse-glob": "^3.0.29", | ||
"@types/xml": "^1.0.6", | ||
"@typescript-eslint/eslint-plugin": "^5.4.0", | ||
"@typescript-eslint/parser": "^5.4.0", | ||
"commitizen": "^4.2.4", | ||
"commitlint": "^15.0.0", | ||
"eslint": "^8.3.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"expect.js": "^0.3.1", | ||
"husky": "^7.0.4", | ||
"lint-staged": "^12.1.2", | ||
"mocha": "^9.1.3", | ||
"nyc": "^15.1.0", | ||
"prettier": "^2.4.1", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.60.1", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"semantic-release": "^18.0.0", | ||
"typescript": "^4.5.2" | ||
} | ||
} |
<h1 align="center"> | ||
<br> | ||
<a href="https://htmlhint.com"><img src="https://raw.githubusercontent.com/htmlhint/htmlhint/develop/src/img/htmlhint.png" alt="Logo HTMLHint" width="170"></a> | ||
<a href="https://htmlhint.com"><img src="https://raw.githubusercontent.com/htmlhint/HTMLHint/master/website/static/img/htmlhint.png" alt="Logo HTMLHint" width="170"></a> | ||
<br> | ||
@@ -21,3 +21,3 @@ HTMLHint | ||
</a> | ||
<img src="https://badgen.net/badge/license/MIT/green" alt="MIT Licence" /> | ||
<img src="https://badgen.net/badge/license/MIT/green" alt="MIT License" /> | ||
<a href="https://discord.gg/nJ6J9CP"> | ||
@@ -32,3 +32,3 @@ <img src="https://img.shields.io/badge/chat-on%20discord-7289da.svg" alt="Chat"> | ||
<p align="center"> | ||
<a href="#installation-and-usage">How To Use</a> • <a href="#contributing">Contributing</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> | ||
@@ -35,0 +35,0 @@ |
Sorry, the diff of this file is too big to display
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
306172
33
55
0
3711
+ Addednode-fetch@^2.6.2
+ Addedasync@3.2.2(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedcommander@8.3.0(transitive)
+ Addedglob@7.2.3(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
- Removedrequest@2.88.2
- Removedajv@6.12.6(transitive)
- Removedasn1@0.2.6(transitive)
- Removedassert-plus@1.0.0(transitive)
- Removedasync@3.2.0(transitive)
- Removedasynckit@0.4.0(transitive)
- Removedaws-sign2@0.7.0(transitive)
- Removedaws4@1.13.2(transitive)
- Removedbcrypt-pbkdf@1.0.2(transitive)
- Removedcaseless@0.12.0(transitive)
- Removedchalk@4.0.0(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removedcommander@5.1.0(transitive)
- Removedcore-util-is@1.0.2(transitive)
- Removeddashdash@1.14.1(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removedecc-jsbn@0.1.2(transitive)
- Removedextend@3.0.2(transitive)
- Removedextsprintf@1.3.0(transitive)
- Removedfast-deep-equal@3.1.3(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedforever-agent@0.6.1(transitive)
- Removedform-data@2.3.3(transitive)
- Removedgetpass@0.1.7(transitive)
- Removedglob@7.1.6(transitive)
- Removedhar-schema@2.0.0(transitive)
- Removedhar-validator@5.1.5(transitive)
- Removedhttp-signature@1.2.0(transitive)
- Removedis-typedarray@1.0.0(transitive)
- Removedisstream@0.1.2(transitive)
- Removedjsbn@0.1.1(transitive)
- Removedjson-schema@0.4.0(transitive)
- Removedjson-schema-traverse@0.4.1(transitive)
- Removedjson-stringify-safe@5.0.1(transitive)
- Removedjsprim@1.4.2(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedoauth-sign@0.9.0(transitive)
- Removedperformance-now@2.1.0(transitive)
- Removedpsl@1.15.0(transitive)
- Removedpunycode@2.3.1(transitive)
- Removedqs@6.5.3(transitive)
- Removedrequest@2.88.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsshpk@1.18.0(transitive)
- Removedtough-cookie@2.5.0(transitive)
- Removedtunnel-agent@0.6.0(transitive)
- Removedtweetnacl@0.14.5(transitive)
- Removeduri-js@4.4.1(transitive)
- Removeduuid@3.4.0(transitive)
- Removedverror@1.10.0(transitive)
Updatedasync@3.2.2
Updatedchalk@^4.1.2
Updatedcommander@^8.3.0
Updatedglob@^7.2.0