Skip to content

Commit 471dfc3

Browse files
committed
fix: Init ast in commentsExistBetween
1 parent a2b9dd5 commit 471dfc3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

apps/oxlint/src-js/plugins/source_code.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ export const SOURCE_CODE = Object.freeze({
295295
* @returns `true` if one or more comments exist.
296296
*/
297297
commentsExistBetween(nodeOrToken1: NodeOrToken, nodeOrToken2: NodeOrToken): boolean {
298+
if (ast === null) initAst();
299+
298300
// Find the first comment after `nodeOrToken1` ends.
299301
// Check if it ends before `nodeOrToken2` starts.
300302
const { comments } = ast,

0 commit comments

Comments
 (0)