Proposal: Add `NoSubstitutionTemplate` to `StringLiteral` Definition

Wed Jan 9 17:35:13 UTC 2019

Some teams opt to use exclusively template strings in their code (see template literals are strictly better strings<> for some reasoning).

This is almost supported by ECMA, but for the fact that `StringLiteral`<> is expressly defined as either a single quote or double quote string, excluding `NoSubstitutionTemplate`s<>.

I contend that adding `NoSubstitutionTemplate`s<> to the definition of `StringLiteral`<> will bring the benefit of allowing teams to completely opt to use only template strings instead of mixing quote marks, while having very little risk or downside, if any at all.

`NoSubstitutionTemplate`s<> by nature are completely defined at "compile" time, essentially being exact same in functionality as standard `StringLiteral`s<>. Let's make it so in the grammar as well?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list