I think though that the concern here is a little misplaced given the constraints that HTM and lit-html work under - which is that the template strings themselves, without the values, have to be well-formed because they're passed to the HTML parser without values.
In HTM, `<${tag}>...<${tag}${slash}>` is not possible to interpret as a possibly self-closing tag because self-closing tags are expanded before values are written into VDOM.
In lit-html `<${tag}>` is not allowed at all. So we know what the tag name will be, and what attributes and properties are bound. The same amount of type-checking is possible as with JSX.
I think though that the concern here is a little misplaced given the constraints that HTM and lit-html work under - which is that the template strings themselves, without the values, have to be well-formed because they're passed to the HTML parser without values.
In HTM, `<${tag}>...<${tag}${slash}>` is not possible to interpret as a possibly self-closing tag because self-closing tags are expanded before values are written into VDOM.
In lit-html `<${tag}>` is not allowed at all. So we know what the tag name will be, and what attributes and properties are bound. The same amount of type-checking is possible as with JSX.