Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 736 Bytes

no-unused-vars.md

File metadata and controls

31 lines (22 loc) · 736 Bytes

disallow unused variable definitions of v-for directives or scope attributes (vue/no-unused-vars)

  • ⚙️ This rule is included in all of "plugin:vue/essential", "plugin:vue/strongly-recommended" and "plugin:vue/recommended".

This rule report variable definitions of v-for directives or scope attributes if those are not used.

📖 Rule Details

👎 Examples of incorrect code for this rule:

<template>
  <ol v-for="i in 5"><!-- "i" is defined but never used. -->
    <li>item</li>
  </ol>
</template>

👍 Examples of correct code for this rule:

<template>
  <ol v-for="i in 5">
    <li>{{i}}</li><!-- "i" is defined and used. -->
  </ol>
</template>

🔧 Options

Nothing.