How to use the htmlhint.default function in htmlhint

To help you get started, we’ve selected a few htmlhint examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 337547038 / Automated-build-tools-for-front-end / guilin / lib / htmlhint.js View on Github external
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)
    }
  })
}
github EvgenyOrekhov / lints / src / linters / htmlhint.js View on Github external
/*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,
github groupe-sii / sonar-web-frontend-reporters / lib / reporters / htmlhint.reporter.js View on Github external
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'
    };