Skip to content
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

Report type errors in attributes & properties of elements #17

Open
Matsuuu opened this issue Apr 24, 2023 · 1 comment
Open

Report type errors in attributes & properties of elements #17

Matsuuu opened this issue Apr 24, 2023 · 1 comment
Assignees

Comments

@Matsuuu
Copy link
Owner

Matsuuu commented Apr 24, 2023

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'

@Matsuuu Matsuuu self-assigned this Apr 24, 2023
@Matsuuu
Copy link
Owner Author

Matsuuu commented Aug 22, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant