Skip to content

Accomodate for key being passed withing a v-bind object of props #2123

Open
@RainbowGiantSquid

Description

@RainbowGiantSquid

What rule do you want to change?

https://eslint.vuejs.org/rules/valid-v-for.html

Does this change cause the rule to produce more or fewer warnings?
fewer

How will the change be implemented? (New option, new default behavior, etc.)?
needs to accomodate for the key being passed in the v-bind object

Please provide some example code that this change will affect:
currently throwing a warning with missing key directive

<ComponentName v-for="item in array" v-bind="{key: item.id, anotherProp, oneMoreProp}" />

//another case:

<ComponentName v-for="(item, key) in array" v-bind="{key, anotherProp, oneMoreProp}" />

What does the rule currently do for this code?

throwing a 'require v-bind:key directive'

What will the rule do after it's changed?

Will not throw the warning when key is passed in an object with other props.

Additional context

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