# san/valid-s-else-if

enforce valid s-else-if 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-if directive is valid.

# 📖 Rule Details

This rule reports s-else-if directives in the following cases:

  • The directive does not have that attribute value. E.g. <div s-if="foo"></div><div s-else-if></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-if="bar"></div>
  • The directive is on the elements which have s-if/s-else directives. E.g. <div s-if="foo" s-else-if="bar"></div>
<template> <!-- ✓ GOOD --> <div s-if="foo"/> <div s-else-if="bar"/> <!-- ✗ BAD --> <div s-else-if/> <div s-if="foo" s-else-if="bar"/> </template>
Now loading...

Note

This rule does not check syntax errors in directives because it's checked by san/no-parsing-error rule.

# 🔧 Options

Nothing.

# 🔍 Implementation

Last Updated: 10/26/2021, 7:23:11 AM