vue/no-irregular-whitespace
テンプレート式の不規則な空白文字を検出します。
| 既定の重大度 | プリセット | 自動修正 | オプション |
|---|---|---|---|
warning |
なし | なし | なし |
適用範囲:Vue SFC のテンプレートと各ブロック。ルールに必要な script の文脈も例に含めています。
悪い例
式に改行しない空白が含まれています。
<template>
<p>{{ value + other }}</p>
</template>
良い例
通常のソースコード用空白を使います。
<template>
<p>{{ value + other }}</p>
</template>
設定(Vite+)
import { defineConfig } from "@vizejs/vite-plugin/vite-plus";
export default defineConfig({}).withVue({
linter: {
"preset": "incremental",
"rules": {
"vue/no-irregular-whitespace": "warn"
}
},
});
設定したら vp run lint を実行します。