Hacker News new | ask | show | jobs
by lauritzsh 2670 days ago
I haven't looked much into lit-html but is it possible to type check your templates like you can do with JSX? That is one big advantage I found for JSX compared to template-based frameworks.
2 comments

All components, expressions, etc are in template curlies `${}` so type checking works out of the box. If you mean type checking on HTML properties, no it does not.

Lit HTML seems very extensible, so it should be possible to add support for thus.

It's possible. There's a VS Code extension that does this already called lit-plugin. If it becomes easier to add TypeScript compiler plugins via configuration, then I'm sure one will appear, allowing errors at build time.