vue/no-multi-spaces
Disallow multiple consecutive spaces.
| Default severity | Presets | Automatic fix | Options |
|---|---|---|---|
warning |
happy-path, nuxt, ecosystem, opinionated |
Yes | None |
Applies to: Vue SFC templates and blocks, with script context where the rule requires it.
Bad
Two spaces separate attributes or the element name and the first attribute.
<template>
<div class="panel"></div>
<div class="panel" id="main"></div>
</template>
Good
Single spaces separate the same attributes.
<template>
<div class="panel"></div>
<div class="panel" id="main"></div>
</template>
Configuration (Vite+)
import { defineConfig } from "@vizejs/vite-plugin/vite-plus";
export default defineConfig({}).withVue({
linter: {
"preset": "incremental",
"rules": {
"vue/no-multi-spaces": "warn"
}
},
});
Then run vp run lint.