How to use web-component-analyzer - 2 common examples

To help you get started, we’ve selected a few web-component-analyzer 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 runem / lit-analyzer / packages / lit-analyzer / src / analyze / default-lit-analyzer-context.ts View on Github external
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
			);
github runem / lit-analyzer / packages / lit-analyzer / src / analyze / default-lit-analyzer-context.ts View on Github external
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;
		}
	}

web-component-analyzer

CLI that analyzes web components

MIT
Latest version published 6 months ago

Package Health Score

70 / 100
Full package analysis