For AI agents: the complete documentation index is available at https://rslint.rs/llms.txt, the full documentation bundle is available at https://rslint.rs/llms-full.txt, and this page is available as Markdown at https://rslint.rs/rules/eslint/no-template-curly-in-string.md.
close

no-template-curly-in-string

Added in v0.1.14

Configuration

rslint.config.ts
import { defineConfig, js } from '@rslint/core';

export default defineConfig([
  js.configs.recommended,
  {
    rules: {
      'no-template-curly-in-string': 'error',
    },
  },
]);

Rule Details

Disallows template literal placeholder syntax (${expression}) inside regular strings. This is almost always a mistake where the developer intended to use a template literal (backtick-delimited string) but accidentally used single or double quotes instead, so the placeholder is treated as a literal string rather than being interpolated.

Examples of incorrect code for this rule:

var greeting = 'Hello, ${name}!';

var query = 'SELECT * FROM ${table}';

var msg = 'The value is ${a + b}';

Examples of correct code for this rule:

var greeting = `Hello, ${name}!`;

var query = `SELECT * FROM ${table}`;

var literal = 'This is a dollar sign: ${}'; // intentional

Original Documentation