diff --git a/packages/codemods/typescript/use-template-literals/src/index.ts b/packages/codemods/typescript/use-template-literals/src/index.ts index 26c232d9e..c006a9f85 100644 --- a/packages/codemods/typescript/use-template-literals/src/index.ts +++ b/packages/codemods/typescript/use-template-literals/src/index.ts @@ -8,11 +8,11 @@ const transformHelper = (node: BinaryExpression, api: API) => { const leftNode = node.left; const rightNode = node.right; const left = - leftNode && leftNode.type === "StringLiteral" + isStringLiteral(leftNode) ? j.literal(leftNode.value) : leftNode; const right = - rightNode && rightNode.type === "StringLiteral" + isStringLiteral(rightNode) ? j.literal(rightNode.value) : rightNode;