Skip to content

Commit a2c4af2

Browse files
authored
Fix false positives for import brace in vue/script-indent rule (#1770)
1 parent f527e27 commit a2c4af2

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

Diff for: lib/utils/indent-common.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1573,10 +1573,10 @@ module.exports.defineVisitor = function create(
15731573
)
15741574
)
15751575
processNodeList(namedSpecifiers, leftBrace, rightBrace, 1)
1576-
for (const token of tokenStore.getTokensBetween(
1577-
leftBrace,
1576+
for (const token of [
1577+
...tokenStore.getTokensBetween(leftBrace, rightBrace),
15781578
rightBrace
1579-
)) {
1579+
]) {
15801580
const i = beforeTokens.indexOf(token)
15811581
if (i >= 0) {
15821582
beforeTokens.splice(i, 1)
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!--{}-->
2+
<script>
3+
import Def, {
4+
foo
5+
} from 'mod';
6+
import
7+
Def2, {
8+
bar
9+
} from 'mod';
10+
</script>
11+
<!-- https://github.com/vuejs/eslint-plugin-vue/issues/1766 -->

0 commit comments

Comments
 (0)