vue/html-indent
eslint-plugin-vue
Safe autofixRecommended
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/html-indent": "error",
},
},
]; <div class="foo">
Hello.
</div>
</template> <div id=""
class=""
some-attr=""
/>
</template> <div>
<span>
Hello!
</span>
</div>
</template><div class="foo">
Hello.
</div>
<div class="foo">
Hello.
</div>
<div class="foo"
:foo="bar"
>
World.
</div>
<div
id="a"
class="b"
:other-attr="{
aaa: 1,
bbb: 2
}"
@other-attr2="
foo();
bar();
"
>
{{
displayMessage
}}
</div> <div
id="a"
class="b"
other-attr=
"{longname: longvalue}"
other-attr2
="{longname: longvalue}"
>
Text
</div>
</template> <div
id="a"
class="b"
other-attr=
"{longname: longvalue}"
other-attr2
="{longname: longvalue}"
>
Text
</div>
</template>Examples from the ESLint documentation.
vue/html-indent
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/html-indent": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Require or disallow a space before tag's closing brackets
Require or disallow a line break before tag's closing brackets
Require a line break before and after the contents of a multiline element
Enforce unified spacing in mustache interpolations