Skip to main content

No Template Curly in String

Catch ${...} inside regular strings so missing backticks are found before the placeholder appears literally in output.

Summary

The no-template-curly-in-string rule reports any regular string literal ("..." or '...') that contains ${...} syntax. This almost always means the developer intended to use a template literal but forgot the backticks.

Why Use This Rule?

  1. Prevents ${name} from appearing literally in output when the developer meant to interpolate.
  2. Catches missing backticks at lint time instead of discovering wrong output at runtime.

Examples

Configuration

Options

warning

ignoreFiles is an escape hatch for files where this rule genuinely does not apply. It is not intended for routine use.

OptionTypeDefaultDescription
ignoreFilesstring[][]File patterns to skip.

Autofix

Autofix is not available for this rule. Flagged code must be updated manually.

Troubleshooting

  • Test files are flagged — Add the test file patterns to the ignoreFiles option so the rule skips them.
  • Template literals are flagged — Only regular strings ("..." and '...') are checked. Template literals with backticks are never flagged.