Remove unnecessary template literal

Simplify a template literal with a single inner expression and no prefix or suffix.

Remove unnecessary template literal

Why is this useful?

Unnecessary template literals add accidental complexity. They make the code harder to understand and can prevent the detection of further improvement opportunities.

What do I need to consider?

Removing template expressions that only contain a single expression and no prefix or suffix is safe when that expression is a string. When the expression is of a type other than string, a type change occurs that can change the code's behavior.

Configuration

Related Code Assists

Learn More

Available In