Open hampoelz opened 3 weeks ago
good catch
we explicitly don't allow tag bindings (from before lit allowed them)
this is a tough one to fix though. if we remove that, we'll be allowing all tag name bindings even though lit only supports ones which use literal
we can't easily detect if you're using literal
either since we're only linting syntax, i.e. we don't have hold of the type checker etc. we could, but it'd then make this rule a typed rule (requires typescript to run)
would be good to get some opinions on this. i'd be tempted to just allow them all and hope the user knows what they're doing
The best solution would of course be to add typescript support as an optional config (for example lit/typescript
), especially if there are other rules that would benefit from typescript.
Otherwise it would probably be enough to add a note to the docs stating that in this case the rules can be ignored and can be configured as warning.
I agree
I wonder how easy it will be to check for the existence of tseslint in the parser services. Then if it exists, we do a more thorough check. Otherwise we allow all tag bindings
The following minimal code triggers the rules "lit/binding-positions" and "lit/no-invalid-html", although it should be completely valid according to the lit documentation (https://lit.dev/docs/templates/expressions/#static-expressions).