Skip to content

Commit f8ed32e

Browse files
committed
Fix comments order
1 parent 01ed265 commit f8ed32e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/ast/nodes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { ScopeManager } from "eslint-scope"
77
import type { ParseError } from "./errors"
88
import type { HasLocation } from "./locations"
99
import type { Token } from "./tokens"
10-
// eslint-disable-next-line node/no-extraneous-import -- ignore
10+
1111
import type { TSESTree } from "@typescript-eslint/utils"
1212

1313
//------------------------------------------------------------------------------

src/script-setup/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,10 @@ export function parseScriptSetupElements(
308308
}
309309
result.ast.tokens.sort((a, b) => a.range[0] - b.range[0])
310310
}
311+
312+
if (result.ast.comments != null) {
313+
result.ast.comments.sort((a, b) => a.range[0] - b.range[0])
314+
}
311315
result.ast.body.sort((a, b) => a.range[0] - b.range[0])
312316

313317
const programStartOffset = result.ast.body.reduce(

0 commit comments

Comments
 (0)