Skip to content

Commit

Permalink
fix: comments may be undefined
Browse files Browse the repository at this point in the history
fixed #6
  • Loading branch information
KeJunMao committed Jan 27, 2024
1 parent ff20882 commit c6e09e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions playground/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ console.log(9)
// #else
console.log(10)
// #endif

//error comment

Check failure on line 33 in playground/main.ts

View workflow job for this annotation

GitHub Actions / lint

Expected exception block, space or tab after '//' in comment
2 changes: 1 addition & 1 deletion src/core/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function parseComment(line: string) {

return {
type: comment?.type,
content: content?.trim(),
content: content?.trim() ?? '',
}
}

Expand Down

0 comments on commit c6e09e3

Please sign in to comment.