Some teams opt to use exclusively template strings in their code (see template literals are strictly better strings<https://ponyfoo.com/articles/template-literals-strictly-better-strings> for some reasoning).
This is almost supported by ECMA, but for the fact that `StringLiteral`<https://tc39.github.io/ecma262/#prod-StringLiteral> is expressly defined as either a single quote or double quote string, excluding `NoSubstitutionTemplate`s<https://tc39.github.io/ecma262/#prod-NoSubstitutionTemplate>. I contend that adding `NoSubstitutionTemplate`s<https://tc39.github.io/ecma262/#prod-NoSubstitutionTemplate> to the definition of `StringLiteral`<https://tc39.github.io/ecma262/#prod-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<https://tc39.github.io/ecma262/#prod-NoSubstitutionTemplate> by nature are completely defined at "compile" time, essentially being exact same in functionality as standard `StringLiteral`s<https://tc39.github.io/ecma262/#prod-StringLiteral>. Let's make it so in the grammar as well?
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss