Skip to content

Commit

Permalink
refactor: use nullish coalescing instead of or operator
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaStevens committed Feb 9, 2023
1 parent 586a349 commit 2d85961
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 2d85961

Please sign in to comment.