How to prevent Prettier/Vetur from formatting this line:
import { defineComponent, reactive, computed, ref } from 'vue'
to this:
import {
defineComponent,
reactive,
computed,
ref
} from 'vue'
How to prevent Prettier/Vetur from formatting this line:
import { defineComponent, reactive, computed, ref } from 'vue'
to this:
import {
defineComponent,
reactive,
computed,
ref
} from 'vue'
Copyright © 2021 Jogjafile Inc.
That formatting occurs when the line width exceeds the configured
printWidth
(default is 80 characters). I assume your example is just a truncated version of a lengthy line, longer than 80 characters.Increase
printWidth
to avoid the line wrapping:If using ESLint+Prettier (in a Vue CLI scaffolded project), configure ESLint's
prettier/prettier
options:Be aware that Vetur only supports formatting the full document, so formatting a selected line does not work in SFC
<script>
blocks.