Typescript to use-template-literals - Use Template Literals

verified codemod icon

This codemod replaces string concatenations with template literals.

TypeScript
jscodeshift
Estimated time saving
~2 minutes/occurrence
Change mode
Autonomous
Applicability criteria

TypeScript version higher or equal to 1.4.

Made by
Codemod.com
Codemod.com

Usage →

Codemod CLI:

intalling vs code extension tooltip icon
codemod typescript/use-template-literals
copy CLI command icon

Codemod VS Code extension:

intalling vs code extension tooltip icon
vs code logo
Run in VS Code

Description

This codemod replaces string concatenations with template literals.

Before

const name = 'John'; const greeting = 'Hello, ' + name + '!';

After

const name = 'John'; const greeting = `Hello, ${name}!`;