-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unknown attribute false positive #351
Comments
We're experiencing this as well. Any ideas here? It seems like the analyzer isn't respecting the
It just happens to pass if it's only one word, since in that case the property name and the attribute name are the same |
This happens when To get around this, I believe you may be able to add either an So if you have a component definition like this /**
* @attr hide-label - Hide the label.
*/
@customElement("my-element")
export class MyElement extends LitElement {
@property({ attribute: "hide-label", type: Boolean })
hideLabel = false;
...
} Then Unfortunately, this means you have to duplicate the attribute name in two places if you want it to work with As for why this is, my understanding is that
To avoid having to add the
|
Stackblitz with issue: (run
lit-analyzer src
to see output)https://stackblitz.com/edit/vitejs-vite-o6yr4r?file=src%2Fmy-element.ts
output
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 tsconfigOriginally posted by @JimSchofield in #181 (comment)
The text was updated successfully, but these errors were encountered: