Open jrencz opened 1 year ago
Additionally when I run lit-analyzer
with just one file, instead of errors from no-missing-import
I get errors from no-unknown-tag-name
. Reason will be the same, but if analyser has access to other files it does know the tag name, but complains about it not being properly imported
got the same issue with imports using tsconfig paths.
Initially I didn't use
compilerOptions.paths
, but I'm now adding that to the project. Presence of that setting intsconfig.json
does not affect lit-analyser, but as I started gradually replacing imports in component modules I got some false positives fromno-missing-import
ruleI narrowed down the problem down a little bit, here's my investigation (collapsed)
If I'm not mistaken the problem is that
analyzeCommand
creates context with access to program, but not project (I assume that it's "project" level what knows about paths):https://github.com/runem/lit-analyzer/blob/56489d04242b35d692b1db4d0f776f9ca0da19b9/packages/lit-analyzer/src/lib/cli/analyze-command.ts#L24-L35
The only context that has access to that is this one:
https://github.com/runem/lit-analyzer/blob/8360bef72c4f9dd8170fc6be4f553c7c17958011/packages/ts-lit-plugin/src/index.ts#L52-L60