Skip to content

Commit 32f1eb6

Browse files
committed
refactor
1 parent d9f442b commit 32f1eb6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/utils/indent-common.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ module.exports.defineVisitor = function create(
301301
tokenStore.getTokenAfter(node)
302302

303303
/** @type {SourceCode.CursorWithSkipOptions} */
304-
const option = {
304+
const cursorOptions = {
305305
includeComments: true,
306306
filter: (token) =>
307307
token != null &&
@@ -311,9 +311,11 @@ module.exports.defineVisitor = function create(
311311
token.type === 'HTMLEndTagOpen' ||
312312
token.type === 'HTMLComment')
313313
}
314-
for (const token of endToken
315-
? tokenStore.getTokensBetween(node.startTag, endToken, option)
316-
: tokenStore.getTokensAfter(node.startTag, option)) {
314+
const contentTokens = endToken
315+
? tokenStore.getTokensBetween(node.startTag, endToken, cursorOptions)
316+
: tokenStore.getTokensAfter(node.startTag, cursorOptions)
317+
318+
for (const token of contentTokens) {
317319
ignoreTokens.add(token)
318320
}
319321
ignoreTokens.add(endToken)

0 commit comments

Comments
 (0)