Skip to content

Extend no-duplicate-attributes with new option allowedDOMProps #1925

Open
@mrzdevcore

Description

@mrzdevcore

What rule do you want to change?
no-duplicate-attributes

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

How will the change be implemented? (New option, new default behavior, etc.)?
New option: allowedDOMProps

Please provide some example code that this change will affect:

{
  "vue/no-duplicate-attributes": ["error", {
    "allowCoexistClass": true,
    "allowCoexistStyle": true,
    "allowedDOMProps": ["name"]
  }]
}
 <MyComponent :name="'test'" :name.prop="def" />

What does the rule currently do for this code?
nothing

What will the rule do after it's changed?

  • allowedDOMProps (Array<string>) ... Enables [v-bind:attribute-name.prop] directive to coexist with [v-bind:attribute-name] or [attribute-name] attribute. Default is []

Additional context

Pull request

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