Repository: vuejs/eslint-plugin-vue (js)

Issue:
Incorrect multiline import indent
<!--
  ❗Please don't ignore this template.❗

  If you ignore it, we're just going to respond asking you to fill it out, which wastes everyone's time.
  The more relevant information you can include, the faster we can find the issue and fix it without asking you for more info.
-->

<!--
  Before posting the issue, please confirm that the problem you're getting
  is not related with your code editor configuration.
  To make sure it's not, run: yarn eslint src/your-file.vue
-->

**Checklist**

- [x] I have tried restarting my IDE and the issue persists.
- [x] I have read the [FAQ](https://eslint.vuejs.org/user-guide/#faq) and my problem is not listed.
<!-- If you do not read the FAQ and open an issue that is listed in the FAQ, we may silently close the issue. -->

**Tell us about your environment**

- **ESLint version:** 7.23.0
- **eslint-plugin-vue version:** 7.12.0 

**Please show your full configuration:**
<!-- Paste content of your .eslintrc file -->
```json5
module.exports = {
  extends: [
    'plugin:vue/recommended',
  ],
  plugins: ['vue'],
  rules: {
    'vue/script-indent': ['warn', 4, {
        baseIndent: 1,
        switchCase: 1,
    }],
  },
};
```

**What did you do?**	
<!-- Please include the actual source code causing the issue. -->
```vue
<script lang="ts">
    import {
        computed, defineComponent, PropType, ref, watch,
    } from '@vue/composition-api';
```

**What did you expect to happen?**
Nothing

**What actually happened?**
`15:1  warning  Expected indentation of 8 spaces but found 4 spaces  vue/script-indent`

Temporary workaround - add 'ImportDeclaration' to `ignores` option of `vue/script-indent` rule.



Pull request description:
Fix false positives for trailing comma with import in `vue/script-indent` rule


fixes #1524

Patch:
diff --git a/lib/utils/indent-common.js b/lib/utils/indent-common.js
index 7d2349d3..8ec6bbe4 100644
--- a/lib/utils/indent-common.js
+++ b/lib/utils/indent-common.js
@@ -1498,8 +1498,11 @@ module.exports.defineVisitor = function create(
       }
       if (namedSpecifiers.length) {
         const leftBrace = tokenStore.getTokenBefore(namedSpecifiers[0])
-        const rightBrace = tokenStore.getTokenAfter(
-          namedSpecifiers[namedSpecifiers.length - 1]
+        const rightBrace = /** @type {Token} */ (
+          tokenStore.getTokenAfter(
+            namedSpecifiers[namedSpecifiers.length - 1],
+            isClosingBraceToken
+          )
         )
         processNodeList(namedSpecifiers, leftBrace, rightBrace, 1)
         for (const token of tokenStore.getTokensBetween(


Test patch:
diff --git a/tests/fixtures/script-indent/import-declaration-11.vue b/tests/fixtures/script-indent/import-declaration-11.vue
new file mode 100644
index 00000000..83289b1f
--- /dev/null
+++ b/tests/fixtures/script-indent/import-declaration-11.vue
@@ -0,0 +1,7 @@
+<!--{ "options": [4, { "baseIndent": 1, "switchCase": 1 } ] }-->
+<script>
+    import {
+        computed, defineComponent, PropType, ref, watch,
+    } from '@vue/composition-api';
+</script>
+<!-- https://github.com/vuejs/eslint-plugin-vue/issues/1524 -->