Skip to content

Commit b00c993

Browse files
authored
Disallow template literals if interpolation and special-character handling are not needed (#903)
1 parent 33b8745 commit b00c993

File tree

6 files changed

+20
-16
lines changed

6 files changed

+20
-16
lines changed

.changeset/hot-geese-deliver.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+
Disallow template literals if interpolation and special-character handling are not needed

biome.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
},
2323
"style": {
2424
"noNamespace": "error",
25-
"noUnusedTemplateLiteral": "off",
2625
"useConsistentArrayType": {
2726
"level": "error",
2827
"options": { "syntax": "shorthand" }

src/cli.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ if (args[2] === "--help" || args[2] === "-h") {
4040
}
4141

4242
const disclaimerLines = [
43-
`╔════════════════════════════════════════════════════════╗`,
44-
`║ Please review the code change thoroughly for required ║`,
45-
`║ functionality before deploying it to production. ║`,
46-
`║ ║`,
47-
`║ If the transformation is not complete or is incorrect, ║`,
48-
`║ please report the issue on GitHub. ║`,
49-
`╚════════════════════════════════════════════════════════╝`,
50-
``,
43+
"╔════════════════════════════════════════════════════════╗",
44+
"║ Please review the code change thoroughly for required ║",
45+
"║ functionality before deploying it to production. ║",
46+
"║ ║",
47+
"║ If the transformation is not complete or is incorrect, ║",
48+
"║ please report the issue on GitHub. ║",
49+
"╚════════════════════════════════════════════════════════╝",
50+
"",
5151
];
5252

5353
const parser = getJsCodeshiftParser();

src/transforms/v2-to-v3/client-instances/getObjectWithUpdatedAwsConfigKeys.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const getUnsuppportedComment = (keyName: string) =>
1515

1616
const getCodemodUnsuppportedComments = (keyName: string) => [
1717
` The transformation for ${keyName} is not implemented.`,
18-
` Refer to UPGRADING.md on aws-sdk-js-v3 for changes needed.`,
18+
" Refer to UPGRADING.md on aws-sdk-js-v3 for changes needed.",
1919
` Please create/upvote feature request on aws-sdk-js-codemod for ${keyName}.`,
2020
];
2121

src/transforms/v2-to-v3/config/AWS_CONFIG_KEY_MAP.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface AwsConfigKeyStatus {
99
*/
1010
export const AWS_CONFIG_KEY_MAP: Record<string, AwsConfigKeyStatus> = {
1111
apiVersion: {
12-
deprecationMessage: `The client uses the "latest" apiVersion.`,
12+
deprecationMessage: 'The client uses the "latest" apiVersion.',
1313
},
1414
computeChecksums: {
1515
deprecationMessage: "Applicable commands of S3 will automatically compute the MD5 checksums.",
@@ -65,8 +65,8 @@ export const AWS_CONFIG_KEY_MAP: Record<string, AwsConfigKeyStatus> = {
6565
newKeyName: "useArnRegion",
6666
},
6767
s3UsEast1RegionalEndpoint: {
68-
description: `S3 client will always use regional endpoint if region is set to "us-east-1".`,
69-
deprecationMessage: `Set region to "aws-global" to send requests to S3 global endpoint.`,
68+
description: 'S3 client will always use regional endpoint if region is set to "us-east-1".',
69+
deprecationMessage: 'Set region to "aws-global" to send requests to S3 global endpoint.',
7070
},
7171
signatureCache: {
7272
deprecationMessage: "SDK always caches the hashed signing keys.",
@@ -78,8 +78,8 @@ export const AWS_CONFIG_KEY_MAP: Record<string, AwsConfigKeyStatus> = {
7878
newKeyName: "tls",
7979
},
8080
stsRegionalEndpoints: {
81-
description: `STS client will always use regional endpoints if set to a specific region.`,
82-
deprecationMessage: `Set region to "aws-global" to send requests to STS global endpoint.`,
81+
description: "STS client will always use regional endpoints if set to a specific region.",
82+
deprecationMessage: 'Set region to "aws-global" to send requests to STS global endpoint.',
8383
},
8484
useAccelerateEndpoint: {},
8585
useDualstackEndpoint: {},

src/transforms/v2-to-v3/transformer.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ describe("v2-to-v3", () => {
3737
describe.each(fixtureSubDirs)("%s", (subDir) => {
3838
const subDirPath = join(fixtureDir, subDir);
3939
it.concurrent.each(getTestFileMetadata(subDirPath))(
40-
`transforms: %s.%s`,
40+
"transforms: %s.%s",
4141
async (filePrefix, fileExtension) => {
4242
const { input, outputCode } = await getTestMetadata(subDirPath, filePrefix, fileExtension);
4343

0 commit comments

Comments
 (0)