vue/html-self-closing
eslint-plugin-vue
Safe autofixRecommended
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/html-self-closing": "error",
},
},
]; <div></div>
<img/>
<MyComponent></MyComponent>
<svg><path d=""></path></svg>
</template> <div/>
<img>
<MyComponent></MyComponent>
<svg><path d=""></path></svg>
</template><div/>
<img>
<MyComponent/>
<svg><path d=""/></svg><div></div>
<img/>
<MyComponent/>
<svg><path d=""/></svg>Examples from the ESLint documentation.
vue/html-self-closing
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/html-self-closing": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Enforce v-on event naming style on custom components in template
Enforce specific casing for component definition name