Skip to content

Commit 94889eb

Browse files
committed
Nullish Coalescing Operator is more accurate for describing undefined comments length
1 parent 26a9df2 commit 94889eb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/slang-printers/print-preserving-empty-lines.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function printIndentedPreservingEmptyLines(
4444
print: PrintFunction,
4545
options: ParserOptions<PrintableNode>
4646
): Doc {
47-
return node.items.length > 0 || (node.comments?.length || 0) > 0
47+
return node.items.length > 0 || (node.comments?.length ?? 0) > 0
4848
? printSeparatedItem(
4949
printPreservingEmptyLines(node, path, print, options),
5050
{ firstSeparator: hardline }

0 commit comments

Comments
 (0)