web-component-analyzer
web-component-analyzer copied to clipboard
Feature request: analyzeProject()
For programmatic use, one of the simplest APIs I can think of would be to analyze a TypeScript project either by folder, or by reference to tsconfig.json file. The entrypoint, rather than the caller, would create the TypeScript program and checker.
Thanks for the suggestion! I already have functionality in the CLI to analyze a glob/directory called analyzeGlob
. This function creates a program and checker.
https://github.com/runem/web-component-analyzer/blob/4f3b5ad4a9c26cb4270519d4153089914da3c1d1/src/cli/util/analyze-globs.ts#L33-L37
It's not aware any tsconfig.json
files, so I'm thinking about supporting giving a path to the tsconfig through the config AnalyzerCliConfig
. This would add/exclude root files in the program by adding include
, exclude
and files
from the tsconfig.json
to the array of globs. It might also be relevant to auto-discover the tsconfig.json
:-)