How to use the htmlhint.default.verify 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 groupe-sii / sonar-web-frontend-reporters / lib / reporters / htmlhint.reporter.js View on Github external
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;
      }
github EvgenyOrekhov / lints / src / linters / htmlhint.js View on Github external
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
                        };
                    })