Remove Unnecessary Template Literal

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

refactoring
P42
P42+

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.

Code Action Safety

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.

Related Code Actions

Learn More

Available In