lit-analyzer
lit-analyzer copied to clipboard
With TypeScript 4.8 we seem to only see info from .d.ts files
Consider this repro: https://github.com/HalfdanJ/lit-element-starter-ts (recommend opening a github codespace to get a stand alone fresh install of the VSCode plugin, with only local configuration)
With a same-project import of some-element
, we still get an unknown tag warning unless it's added to the HTMLElementTagNameMap, and even if it is we get an unknown attribute warning unless we add an @attr
jsdoc tag to SomeElement. It's as though the analyzer can't see the @property
or @customElement
decorators
We should add a unit test configuration with TS 4.8
@bicknellr
I just now put two and two together and realized this is the same as the internal bug we were handed recently. Recap: TypeScript 4.8 changes the location of decorators in the AST and web-component-analyzer's discoverDefinitions
for Lit specifically expects to find decorators in the old position. I'm working on adding support for TypeScript 4.8 in https://github.com/runem/web-component-analyzer/pull/249, which includes updates to look for decorators in the new location.
That PR has been merged but there hasn't been a release since then. Pretty pretty please can you cut a new release? 😄
A new version of this package based on a not-yet-released version of web-component-analyzer
would indeed be highly appreciated. Until that happens, many consumers – especially those who use "no-unknown-tag-name": "error"
etc – cannot upgrade to TypeScript 4.8 and beyond. I don't know how releases are managed or by whom … @runem, @rictic, @bicknellr?
This should be fixed now, install the @next
version