# san/valid-s-else
enforce valid
s-else
directives
- ⚙️ This rule is included in all of
"plugin:san/essential"
,"plugin:san/strongly-recommended"
and"plugin:san/recommended"
.
This rule checks whether every s-else
directive is valid.
# 📖 Rule Details
This rule reports s-else
directives in the following cases:
- The directive has that attribute value. E.g.
<div s-if="foo"></div><div s-else="bar"></div>
- The directive is on the elements that the previous element don't have
s-if
/s-else-if
directives. E.g.<div s-else></div>
- The directive is on the elements which have
s-if
/s-else-if
directives. E.g.<div s-if="foo" s-else></div>
<template>
<!-- ✓ GOOD -->
<div s-if="foo"/>
<div s-else/>
<!-- ✗ BAD -->
<div s-else="foo"/>
<div s-if="foo" s-else></div>
</template>
# 🔧 Options
Nothing.