# san/no-template-shadow
disallow variable declarations from shadowing variables declared in the outer scope
- ⚙️ This rule is included in all of
"plugin:san/strongly-recommended"
and"plugin:san/recommended"
.
no-template-shadow
should report variable definitions of s-for directives or scope attributes if those shadows the variables in parent scopes.
# 📖 Rule Details
This rule aims to eliminate shadowed variable declarations of s-for directives or scope attributes.
<template>
<!-- ✓ GOOD -->
<div s-for="i in 5"></div>
<div s-for="j in 5"></div>
<!-- ✗ BAD -->
<div>
<div s-for="k in 5">
<div s-for="k in 10"></div>
</div>
</div>
<div s-for="l in 5"></div>
</template>
<script>
export default {
initData () {
return {
l: false
}
}
}
</script>
# 🔧 Options
Nothing.