Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const resources: HintResources = {
connector: WebExtensionConnector,
formatters: [WebExtensionFormatter],
hints: enabledHints,
incompatible: [],
missing: [],
parsers: [
CSSParser as any,
HTMLParser as any,
JavaScriptParser as any,
ManifestParser as any
]
};
const engine = new Engine(config, resources);
const problems = await engine.executeOn(new URL(location.href));
const filteredProblems = problems.filter((problem) => {
return problem.severity >= (userConfig.severityThreshold || Severity.warning);
});
engine.formatters.forEach((formatter) => {
formatter.format(filteredProblems, {
resources,
target: location.href
});
});
};