Remove unnecessary template literal
Simplify a template literal with a single inner expression and no prefix or suffix.
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.
Related Code Actions
- Inline into template
- Merge string concatenation
- Convert string to template literal
- Convert template literal to string