runem / lit-analyzer

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

Unknown attribute false positive #351

Open JimSchofield opened 8 months ago

JimSchofield commented 8 months ago

Stackblitz with issue: (run lit-analyzer src to see output) https://stackblitz.com/edit/vitejs-vite-o6yr4r?file=src%2Fmy-element.ts

output

❯ lit-analyzer src
Analyzing 2 files...

./src/my-element.ts

    Unknown attribute 'password-toggle'. Did you mean '?passwordToggle'?
    13:  ?password-toggle=${this.passwordToggle}
    no-unknown-attribute

  ✖ 1 problem in 1 file (0 errors, 1 warning)

We can verify that the attribute exists on the shoelace component: https://github.com/shoelace-style/shoelace/blob/next/src/components/input/input.component.ts#L122

It seems to happen only when strict is used in the tsconfig

Originally posted by @JimSchofield in https://github.com/runem/lit-analyzer/issues/181#issuecomment-1894116519