custom-elements-language-server
custom-elements-language-server copied to clipboard
Report type errors in attributes & properties of elements
Given I have an elements
export type ComponentVariant = "default" | "primary" | "secondary";
class MyComponent extends LitElement {
@property({ type: String })
variant: ComponentVariant = "default";
}
I would want to get diagnostic help when the typing of my attribute doesn't match the one provided.
e.g.
<my-component variant="foobar"></my-component>
Should throw an diagnostics error and underline the variant="foobar" section of the component with an error message like Type '"foobar"' is not assignable to type 'ComponentVariant'
Some stuff related to this is here: https://github.com/Matsuuu/tsc-checker-demoing
Will be continuing on this work next as this will be a major feature