Skip to content

Latest commit

 

History

History
64 lines (48 loc) · 1.27 KB

valid-slot-scope.md

File metadata and controls

64 lines (48 loc) · 1.27 KB

enforce valid slot-scope attributes (vue/valid-slot-scope)

This rule checks whether every slot-scope (or scope) attributes is valid.

📖 Rule Details

This rule reports slot-scope attributes in the following cases:

  • The slot-scope attribute does not have that attribute value. E.g. <div slot-scope></div>

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

👎 Examples of incorrect code for this rule:

<template>
  <TheComponent>
    <template slot-scope>
      ...
    </template>
  </TheComponent>
  <TheComponent>
    <template slot-scope="">
      ...
    </template>
  </TheComponent>
</template>

👍 Examples of correct code for this rule:

<template>
  <TheComponent>
    <template slot-scope="prop">
      ...
    </template>
  </TheComponent>
  <TheComponent>
    <template slot-scope="{ a, b, c }">
      ...
    </template>
  </TheComponent>
  <TheComponent>
    <template slot-scope="[ a, b, c ]">
      ...
    </template>
  </TheComponent>
</template>

🔧 Options

Nothing.

👫 Related rules

Related links