Skip to content

Commit

Permalink
Merge pull request #39 from RebeccaStevens/comments-use-nullish-coale…
Browse files Browse the repository at this point in the history
…scing

refactor: use nullish coalescing instead of or operator
  • Loading branch information
JoshuaKGoldberg authored Feb 9, 2023
2 parents 6b3b5db + 2d85961 commit c68d4bd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/comments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ export function forEachComment(
ts.forEachLeadingCommentRange(
fullText,
// skip shebang at position 0
// TODO: Investigate
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
token.pos === 0 ? (ts.getShebang(fullText) || "").length : token.pos,
token.pos === 0 ? (ts.getShebang(fullText) ?? "").length : token.pos,
commentCallback
);
if (notJsx || canHaveTrailingTrivia(token))
Expand Down

0 comments on commit c68d4bd

Please sign in to comment.