Summary
When pressing Enter inside a <script setup> block, Zed always auto-indents to column 0 (no indent) for top-level statements. This conflicts with the ESLint rule vue/script-indent with baseIndent: 1, which expects one level of indentation inside <script>.
Steps to reproduce
- Configure ESLint with
'vue/script-indent': ['error', 2, { baseIndent: 1 }]
- Open a
.vue file where code inside <script setup> is indented with 2 spaces:
<script setup>
import { ref } from 'vue'
const count = ref(0)
// place cursor at the end of this line and press Enter
</script>
Place cursor at the end of any line inside <script setup> and press Enter
Expected behavior
The new line should maintain the base indentation level (2 spaces) consistent with the rest of the <script setup> content.
Actual behavior
The existing line is re-indented to column 0, removing the base indentation. On save, ESLint fix restores the correct indentation, but the editing experience is disrupted.
Summary
When pressing Enter inside a
<script setup>block, Zed always auto-indents to column 0 (no indent) for top-level statements. This conflicts with the ESLint rulevue/script-indentwithbaseIndent: 1, which expects one level of indentation inside<script>.Steps to reproduce
'vue/script-indent': ['error', 2, { baseIndent: 1 }].vuefile where code inside<script setup>is indented with 2 spaces:Place cursor at the end of any line inside
<script setup>and press EnterExpected behavior
The new line should maintain the base indentation level (2 spaces) consistent with the rest of the
<script setup>content.Actual behavior
The existing line is re-indented to column 0, removing the base indentation. On save, ESLint fix restores the correct indentation, but the editing experience is disrupted.