Skip to content

Linter: html-no-duplicate-attributes should respect ERB Control Flow #458

@marcoroth

Description

@marcoroth

Bug Report

The html-no-duplicate-attributes linter rule should report this using a Duplicate attribute "class" found on tag. Remove the duplicate occurrence. error:

<div 
  class="post"

  <% if active? %> 
    class="active" 
  <% end %> 
>
</div>

Playground

https://herb-tools.dev/playground#DwEwlgbgBAUFUGMA2BDAzmgvAIgA4Hs0AXbGOKYAUijADMoUEjIBTAfikoD5Z55l0WbI2YQW2XhWosAdiE48YXGMAD04CMpUbJAjDgLFS-VPuFNWEpSvWQuQA

Additional Context

With #444 we introduced the ControlFlowTrackingVisitor that should allow us to implement this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions