Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
fs.readFile(src, {encoding: 'utf8'}, function (err, data) {
const messages = htmlhint.default.verify(data, rules);
if (messages.length > 0) {
pass = false;
console.log('\x1B[33m%s\x1B[39m', src);
console.log(messages)
}
clearTimeout(timer);
if (pass) {
timer = setTimeout(() => {
console.log('HtmlCode check passed.')
}, 2000)
}
})
}
/*jslint node */
"use strict";
const htmlhint = require("htmlhint").default;
const Bluebird = require("bluebird");
const {pipeP} = require("../util");
module.exports = function makeLinter({promisedOptions}) {
return function lint({promisedFile}) {
return pipeP([
Bluebird.props,
function lintAndAdaptWarnings({options, file}) {
const warnings = htmlhint.verify(file, options);
return {
linterName: "HTMLHint",
warnings: warnings.map(function adaptWarning({
line,
col: column,
const glob = require('glob-all'),
HTMLHint = require('htmlhint').default,
ReporterType = require('../reporter.enum'),
Reporter = require('../reporter');
module.exports = class HTMLHintReporter extends Reporter {
constructor (options, projectName) {
super(options, projectName);
this.linterName = 'HTMLHint';
}
static defaultOptions () {
return {
src : 'src/**/*.html',
report : 'reports/sonar/htmlhint.json',
rulesFile: '.htmlhintrc'
};