Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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');
}
loadDeps.loaded = true;
Object.keys(htmlhintModule.HTMLRules).forEach((rule) => {
HTMLHint.addRule(htmlhintModule.HTMLRules[rule]);
});
}