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

[no-complex-attribute-binding] Triggers when assigning serializable values to properties that include both objects and non-objects #345

Open
rictic opened this issue Jan 9, 2024 · 1 comment

Comments

@rictic
Copy link
Collaborator

rictic commented Jan 9, 2024

e.g. <sl-radio value="0"> when value has type unknown, we produce the diagnostic:

You are assigning the primitive '0' to a non-primitive type unknown. Use '.' binding instead?

This isn't ideal, because this code should work fine (assuming that value can deserialize the attribute value '0', which I think is a reasonable responsibility to put on it) and my guess is that a static attribute will be cheaper than a dynamic property set to a constant. Certainly cheaper on update, since it's one fewer step to take.

@jpzwarte
Copy link

jpzwarte commented Feb 7, 2024

The workaround for now is to turn these specific checks off in the vscode settings:

  "lit-plugin.rules.no-complex-attribute-binding": "off",
  "lit-plugin.rules.no-incompatible-type-binding": "off"

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

2 participants