Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
processFile (file, options) {
let input = this.readFile(file),
result = HTMLHint.verify(input, options.htmlhint),
severity;
this.openFileIssues(file, null, /^(\s+)?\n$/gm);
for (let message of result) {
switch (message.type) {
case 'error':
severity = this.MAJOR;
break;
case 'warning':
severity = this.MINOR;
break;
default:
severity = this.INFO;
break;
}
function lintAndAdaptWarnings({options, file}) {
const warnings = htmlhint.verify(file, options);
return {
linterName: "HTMLHint",
warnings: warnings.map(function adaptWarning({
line,
col: column,
message,
rule
}) {
return {
line,
column,
message,
ruleId: rule.id
};
})