Skip to content

Commit 91906ba

Browse files
committed
[Refactor] remove unnecessary condition
`canHaveTrailingComma` is defined as `I(lastElem && ...)`, which will always be true when `lastElem === null`.
1 parent 5269980 commit 91906ba

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/language-js/printer-estree.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,8 +1518,7 @@ function printPathNoParens(path, options, print, args) {
15181518
//
15191519
// Note that getLast returns null if the array is empty, but
15201520
// we already check for an empty array just above so we are safe
1521-
const needsForcedTrailingComma =
1522-
canHaveTrailingComma && lastElem === null;
1521+
const needsForcedTrailingComma = lastElem === null;
15231522

15241523
parts.push(
15251524
group(

0 commit comments

Comments
 (0)