Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private findComponentsInFile(sourceFile: SourceFile) {
const analyzeResult = analyzeComponents(sourceFile, {
checker: this.checker,
ts: this.ts,
config: { diagnostics: true, analyzeLibDom: true, excludedDeclarationNames: ["HTMLElement"] }
});
// Forget
const existingResult = this.definitionStore.getAnalysisResultForFile(sourceFile);
if (existingResult != null) {
this.htmlStore.forgetCollection(
{
tags: existingResult.componentDefinitions.map(d => d.tagName),
events: existingResult.globalEvents.map(e => e.name),
attrs: []
},
HtmlDataSourceKind.DECLARED
);
private analyzeSubclassExtensions() {
if (this.hasAnalyzedSubclassExtensions) return;
const result = analyzeLibDomHtmlElement(this.program, this.ts);
if (result != null) {
const extension = convertComponentDeclarationToHtmlTag(result, undefined, { checker: this.checker });
this.htmlStore.absorbSubclassExtension("HTMLElement", extension);
this.hasAnalyzedSubclassExtensions = true;
}
}