Tagged Templates
The Tagged Templates filter allows you to turn certain method calls with a string argument into tagged template literals. By default it supports html
and css
, so you can write html "<div>#{1+2}</div>"
which converts to html`<div>${1+2}</div>`
.
Works nicely with squiggly heredocs for multiline templates as well. If you
need to configure the tag names yourself, pass a template_literal_tags
option to convert
with an array of tag name symbols.
Note: these conversions are only done if eslevel >= 2015