-
Notifications
You must be signed in to change notification settings - Fork 40
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
lit-plugin(no-complex-attribute-binding) when property has a converter #123
Comments
I can have a go at this, though question for @runem: do we keep any context around the original property definition? by the time our visitors get the assignment, the target will just be a typed property will it not? i.e. it won't have any knowledge by that point of if there's a converter or not. my suggested fix is:
|
@bennypowers Thanks for reporting this issue :-) Here are my thoughts:
@43081j Thanks for offering your help! I see that you already found out how to check for custom converters 👍 |
I've run into the same problem. I'm curious why this code would ever be flagged. html`<trigger-mutation refetch-queries="OneQuery,AnotherQuery"></trigger-mutation>` The description is "Disallow attribute bindings with a complex type." I don't see any complex type there. I see an attribute bound to a string, which is the only type allowed in this context. An attribute value is always a string (a DOMString to be precise). We don't need to know anything about the implementation of the custom element to know that. In contrast, this should probably be flagged by the rule: html`<trigger-mutation refetch-queries="${['OneQuery', 'AnotherQuery']}"></trigger-mutation>` because you most likely meant this instead: html`<trigger-mutation .refetchQueries="${['OneQuery', 'AnotherQuery']}"></trigger-mutation>` |
Been a while but iirc it means you have passed a string value (because you used an attribute binding) to a complex property (it is complex because in the class, it isn't a string). Maybe it could be worded better Totally forgot about this and the related PR I opened! I'll see if I can catch myself up on it again some time soon |
I just bumped into this problem. Any updates on this issue? |
looking forward for a solution too. |
Hello!
My intended API is
As such, I've defined
refetchQueries
as:Only to get this error:
As
converter
is intended to cast strings, perhaps this rule should be amended to allow ignoring properties with aconverter
or withtype: Array
ortype: Object
.The text was updated successfully, but these errors were encountered: