# san/no-empty-attributes
disallow empty of attributes
- ⚙️ This rule is included in all of
"plugin:san/essential"
,"plugin:san/strongly-recommended"
and"plugin:san/recommended"
.
# 📖 Rule Details
This rule requires that the class attribute and style attribute cannot be empty by default.
<template>
<!-- ✓ GOOD -->
<div class="abc" />
<div style="abc" />
<!-- ✗ BAD -->
<div class="" />
<div style="" />
<div class=" " />
<div style=" " />
</template>
# 🔧 Options
{
"san/no-empty-attributes": ["error", {
groups: ['attr']
}],
}
groups
:In addition to the class and style, you can also add additional attributes that cannot be empty through group.
# groups: ['attr']
<template>
<!-- ✓ GOOD -->
<div class="abc" />
<div style="abc" />
<div attr="abc" />
<!-- ✗ BAD -->
<div class="" />
<div style="" />
<div attr="" />
<div attr=" " />
</template>