Skip to content

Commit 33b8745

Browse files
authored
Prefer template literals over string concatenation (#901)
1 parent ca4e037 commit 33b8745

File tree

5 files changed

+9
-3
lines changed

5 files changed

+9
-3
lines changed

.changeset/shaggy-rocks-melt.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"aws-sdk-js-codemod": patch
3+
---
4+
5+
Prefer template literals over string concatenation

biome.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
"useConsistentArrayType": {
2727
"level": "error",
2828
"options": { "syntax": "shorthand" }
29-
},
30-
"useTemplate": "off"
29+
}
3130
},
3231
"suspicious": {
3332
"noEmptyBlockStatements": "error"

src/cli.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ try {
5858
({ options, positionalArguments } = parser.parse());
5959
if (positionalArguments.length === 0 && !options.stdin) {
6060
process.stderr.write(
61+
// biome-ignore lint/style/useTemplate: This is a multiline string
6162
"Error: You have to provide at least one file/directory to transform." +
6263
"\n\n---\n\n" +
6364
parser.getHelpText()

src/transforms/v2-to-v3/apis/removePromiseForCallExpression.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export const removePromiseForCallExpression = (
3232
}
3333
default: {
3434
emitWarning(
35+
// biome-ignore lint/style/useTemplate: This is a multiline string
3536
`Removal of .promise() not implemented for parentPath: ${callExpression.parentPath.value.type}\n` +
3637
`Code processed: ${j(callExpression.parentPath).toSource()}\n\n` +
3738
"Please report your use case on https://github.com/aws/aws-sdk-js-codemod\n"

src/utils/getTransformDescription.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const getWrappedBlocks = (sentence: string, blockLength: number): string[] => {
1515
}
1616

1717
// add the word to the current block
18-
currentBlock += word + " ";
18+
currentBlock += `${word} `;
1919
}
2020

2121
// add the final block to the list of blocks

0 commit comments

Comments
 (0)