Skip to content

Add allow rule option to vue/no-template-shadow #2317

Closed
@stefanobartoletti

Description

@stefanobartoletti

What rule do you want to change?
vue/no-template-shadow

Does this change cause the rule to produce more or fewer warnings?
Slightly few warnings, in selected occurrences

How will the change be implemented? (New option, new default behavior, etc.)?
Probably the best way is to set a new option to the existing rule, something like this:

"vue/no-template-shadow": ['error', {
    whitelist: ['allowed', 'variable', 'names'],
}],

I think it can be useful to have the ability to set a whitelist for well known variable names that are allowed to be shadowed, while still being able to throw errors or warnings in all other cases.

It could be possible to have certain selected variable names that have to remain the same (maybe for third party libraries constraints, or for some coding convention), while also wanting to prevent this behavior globally.

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