Skip to main content

js/noTemplateCurlyInString

disallow template literal placeholder syntax in regular strings

ESLint Equivalent: no-template-curly-in-string

Examples

Invalid

const user = 'Faustina';
               const helloUser = 'Hello, ${user}';

 file.ts:2:33 lint/js/noTemplateCurlyInString ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  This string contains an unexpected template string expression.

    1const user = 'Faustina';
  > 2               const helloUser = 'Hello, ${user}';
                                      ^^^^^^^^^^^^^^^^

  Using template string expressions in regular strings is usually a
    typo.