π Enforce consistent style for escaping ${ in template literals.
πΌπ« This rule is enabled in the β
recommended config. This rule is disabled in the βοΈ unopinionated config.
π§ This rule is automatically fixable by the --fix CLI option.
There are multiple ways to escape ${ in a template literal to prevent it from being interpreted as an expression:
\${β escape the dollar sign β$\{β escape the opening brace β\$\{β escape both β
This rule enforces escaping the dollar sign (\${) for consistency.
// β
const foo = `$\{a}`;
// β
const foo = `\$\{a}`;
// β
const foo = `\${a}`;