We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c78ac5f commit 3a14c8aCopy full SHA for 3a14c8a
apps/oxlint/src-js/plugins/tokens.ts
@@ -353,9 +353,6 @@ export function getTokenBefore(
353
let nodeTokens: Token[] | null = null;
354
if (includeComments) {
355
if (tokensWithComments === null) {
356
- // TODO: `tokens` and `comments` are already sorted, so there's a more efficient algorithm to merge them.
357
- // That'd certainly be faster in Rust, but maybe here it's faster to leave it to JS engine to sort them?
358
- // TODO: Once we have our own tokens which have `start` and `end` properties, we can use them instead of `range`.
359
tokensWithComments = [...tokens, ...comments].sort((a, b) => a.range[0] - b.range[0]);
360
}
361
nodeTokens = tokensWithComments;
0 commit comments