Skip to content

Commit e66c64b

Browse files
authored
Use optional chain instead of chained logical expressions (#896)
1 parent 4f28fbb commit e66c64b

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

.changeset/nasty-peaches-complain.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+
Use optional chain instead of chained logical expressions

biome.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
"rules": {
1414
"recommended": true,
1515
"complexity": {
16-
"noForEach": "off",
17-
"useOptionalChain": "off"
16+
"noForEach": "off"
1817
},
1918
"correctness": {
2019
"noNewSymbol": "error",

src/transforms/v2-to-v3/utils/isTrailingCommaUsed.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { Collection, JSCodeshift } from "jscodeshift";
33
export const isTrailingCommaUsed = (j: JSCodeshift, source: Collection<unknown>) => {
44
for (const node of source.find(j.ObjectExpression).nodes()) {
55
// @ts-ignore Property 'extra' does not exist on type 'ObjectExpression'.
6-
if (node.extra && node.extra.trailingComma) {
6+
if (node.extra?.trailingComma) {
77
return true;
88
}
99
}

0 commit comments

Comments
 (0)