runem / lit-analyzer

Monorepository for tools that analyze lit-html templates
MIT License
318 stars 36 forks source link

Treat noChange and nothing as any type in binding #251

Open rictic opened 2 years ago

rictic commented 2 years ago

The noChange and nothing values have special meaning in a lit binding, and they are legal to use everywhere, as they directly specify behavior rather than an ordinary value to be set/rendered

WickyNilliams commented 2 years ago

related https://github.com/runem/lit-analyzer/issues/207

outside of custom directives, you can also trigger analyzer errors using built-ins like the when directive:

html`
  <button
    tabindex=${when(someCondition, () => "-1", () => nothing)}
  ></button>
`