Skip to content

Linter: Consider when a helper method has been overridden as a local variableย #1617

@natematykiewicz

Description

@natematykiewicz
<% ContentTag.order(:name).each do |tag| %>
  <li><%= tag.name %></li>
<% end %>

This code warns "Unknown HTML tag <name>. This is not a standard HTML element. [html-no-unknown-tag]". That's because it believes tag is the ActionView helper method, but the line above has defined tag as a local variable.

One could argue that it should warn that we're shadowing the helper method with a local variable. But at the very least, the current warning is not correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglinter

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions