# san/valid-s-if

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

# 📖 Rule Details

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

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