Skip to content

no-duplicate-attributes should have css exceptions #112

Closed
@nchutchind

Description

@nchutchind
  • ESLint Version: 4.3.0
  • eslint-plugin-vue Version: 3.8.0
  • Node Version: 8.1.4
<span class="label label-rounded" :class="statusColor"></span>
<span style="font-weight:bold;" :style="{ color: activeColor, fontSize: fontSize + 'px' }"></span>

Duplicate attribute 'class'. (vue/no-duplicate-attributes)
Duplicate attribute 'style'. (vue/no-duplicate-attributes)

Class and Style, specifically, should be allowed to be duplicated since they tend to have a mix of static and dynamic content. You often have structural styling that gets set in stone at development time, but want reactive styles or classes applied at runtime.

Perhaps no-duplicate-attributes should take an option for ignoring css attributes (class and style).

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