Skip to content

Linter: Provide autofix for conditionals in erb-no-interpolated-class-names rule #1501

@marcoroth

Description

@marcoroth

We should provide an autofix if the interpolation has static string leaf nodes:

<figure class="attachment attachment--<%= blob.representable? ? "preview" : "file" %>"></figure>

should be fixed to

<figure class="attachment <% if blob.representable? %> attachment--preview <% else %> attachment--file <% end %>"></figure>

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions