Skip to content

Commit

Permalink
Prefer template literals over string concatenation (#901)
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr authored Jul 14, 2024
1 parent ca4e037 commit 33b8745
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/shaggy-rocks-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"aws-sdk-js-codemod": patch
---

Prefer template literals over string concatenation
3 changes: 1 addition & 2 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
"useConsistentArrayType": {
"level": "error",
"options": { "syntax": "shorthand" }
},
"useTemplate": "off"
}
},
"suspicious": {
"noEmptyBlockStatements": "error"
Expand Down
1 change: 1 addition & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ try {
({ options, positionalArguments } = parser.parse());
if (positionalArguments.length === 0 && !options.stdin) {
process.stderr.write(
// biome-ignore lint/style/useTemplate: This is a multiline string
"Error: You have to provide at least one file/directory to transform." +
"\n\n---\n\n" +
parser.getHelpText()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const removePromiseForCallExpression = (
}
default: {
emitWarning(
// biome-ignore lint/style/useTemplate: This is a multiline string
`Removal of .promise() not implemented for parentPath: ${callExpression.parentPath.value.type}\n` +
`Code processed: ${j(callExpression.parentPath).toSource()}\n\n` +
"Please report your use case on https://github.com/aws/aws-sdk-js-codemod\n"
Expand Down
2 changes: 1 addition & 1 deletion src/utils/getTransformDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const getWrappedBlocks = (sentence: string, blockLength: number): string[] => {
}

// add the word to the current block
currentBlock += word + " ";
currentBlock += `${word} `;
}

// add the final block to the list of blocks
Expand Down

0 comments on commit 33b8745

Please sign in to comment.