Open ggecy opened 2 years ago
Just giving this a quick bump as I've otherwise been finding this lib incredibly helpful but this bug has really cramped my CI.
This is definitely polluting my IDE with error messages that are not relevant. A quick patch that I use is to install the ts-lit-plugin and change error level in the tsconfig.json:
"plugins": [
{
"name": "ts-lit-plugin",
"rules": {
"no-nullable-attribute-binding": "warning",
}
}
]
Note that setting the rule value to "off" doesn't work
Hello, I have the following variable defined (and computed later on):
and then used in a template
which shows the following error for class attribute:
This attribute binds the type 'string | null' which can end up binding the string 'null'. Use the 'ifDefined' directive and strict null check?lit-plugin(no-nullable-attribute-binding)(2314)
.This shouldn't be an error according to official lit element documentation and implementation of ifDefined directive - it works with both
undefined
andnull
values and ignores the attribute :For AttributeParts, sets the attribute if the value is defined and removes the attribute if the value is undefined (undefined or null)
I have also tried setting the
no-nullable-attribute-binding
to off in settings yet the error is still shown.