I'm trying to contribute to https://github.com/esphome/dashboard and learn typescript and lit doing that.
Right now I'm trying to add lit-analyzer package to repo and fix all errors is thows.
One of the errors I noticed is:
that is the empty value of the scrimClickAction attribute.
After looking at the definition of mwc-dialog I can see this:
Lit's fromAttribute convertor has no case for string, so it treats strings just as they get it from the HTML DOM object. An empty attribute is returned as an empty string. That is implicit. It's a bug in lit analyzer that it does not accept an empty attribute for a string value. It's not that it didn't extract the type correctly.
According to the docs (https://github.com/material-components/material-web/tree/mwc/packages/dialog#propertiesattributes) setting an empty value will prevent closing the dialog, this is the behavior I want, so setting an empty attribute without an empty value should be fine.
The project I mentioned (esphome/dashboard) works perfectly with empty values for scrimClickAction, so I'd like to know if this is a correct error or a bug in lit-analyzer?
I'm trying to contribute to https://github.com/esphome/dashboard and learn typescript and lit doing that. Right now I'm trying to add lit-analyzer package to repo and fix all errors is thows. One of the errors I noticed is:![image](https://user-images.githubusercontent.com/1741838/192221802-216c3258-380d-4b94-9309-819a3aa26ee9.png)
that is the empty value of the
scrimClickAction
attribute.After looking at the definition of
mwc-dialog
I can see this:the
scrimClickAction
attribute has a string as a type, but as suggested here:According to the docs (https://github.com/material-components/material-web/tree/mwc/packages/dialog#propertiesattributes) setting an empty value will prevent closing the dialog, this is the behavior I want, so setting an empty attribute without an empty value should be fine. The project I mentioned (esphome/dashboard) works perfectly with empty values for
scrimClickAction
, so I'd like to know if this is a correct error or a bug in lit-analyzer?