Skip to content

Rule Proposal: vue/no-shadow #101

Closed
@mysticatea

Description

@mysticatea

Please describe what the rule should do:

no-shadow should report variable definitions of v-for directives or scope attributes if those shadows the variables in parent scopes.

What category of rule is this? (place an "X" next to just one item)

[ ] Enforces code style
[X] Warns about a potential error
[ ] Suggests an alternate way of doing something
[ ] Other (please specify:)

Provide 2-3 code examples that this rule will warn about:

<template>
    <ol v-for="i in 5">
        <ol v-for="i in 5"><!-- "i" is already declared in the upper scope. -->
            <li>item</li>
        </ol>
    </ol>
</template>
<script>
export default {
}
</script>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions