How to use the htmlhint.HTMLHint 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 AtomLinter / linter-htmlhint / lib / index.js View on Github external
const loadDeps = () => {
  if (loadDeps.loaded) {
    return;
  }
  if (!dirname) {
    ({ dirname } = require('path'));
  }
  if (!HTMLHint) {
    const htmlhintModule = require('htmlhint');
    HTMLHint = new htmlhintModule.HTMLHint();
    Object.keys(htmlhintModule.HTMLRules).forEach((rule) => {
      HTMLHint.addRule(htmlhintModule.HTMLRules[rule]);
    });
  }
  if (!findAsync || !generateRange) {
    ({ findAsync, generateRange } = require('atom-linter'));
  }
  if (!fsReadFile) {
    ({ readFile: fsReadFile } = require('fs'));
  }
  if (!tinyPromisify) {
    tinyPromisify = require('tiny-promisify');
  }
  if (!stripJSONComments) {
    stripJSONComments = require('strip-json-comments');
  }