runem / lit-analyzer

Monorepository for tools that analyze lit-html templates
MIT License
317 stars 36 forks source link

lit-analyzer is not compatible with latest TypeScript #302

Closed bicknellr closed 1 year ago

bicknellr commented 1 year ago

lit-analyzer needs to be updated to work with and test on the latest version of TypeScript. Here are a few issues already that either point this out directly or at least seem related:

I haven't scanned through to find all related issues so there are likely others.

pmcelhaney commented 1 year ago

I was about to create yet another issue when I found this one. Here's a really simple test case demonstrating the no-missing-import rule yielding false positives because lit-analyzer can't resolve dependencies.

https://github.com/pmcelhaney/lit-analyzer-ts5-

I've traced the issue to this line.

https://github.com/runem/lit-analyzer/blob/92c084da4d33d6fbdd8b29603d2003387e65dbb3/packages/lit-analyzer/src/lib/analyze/parse/parse-dependencies/visit-dependencies.ts#L148

After upgrading to TypeScript 5, getResolvedModuleWithFailedLookupLocationsFromCache is not in the context.program object, so lit-analyzer can't resolve dependencies and follow imports. I bet that's the root cause of multiple issues.

gautelo commented 1 year ago

Bumping to say, I'm also hopeful for a fix to this.

gautelo commented 1 year ago

I'm guessing this is related to #299

rictic commented 1 year ago

This should be fixed now, install the @next tag