Skip to content

Linter fails to parse next line after a paren-less method call using the hash value omission shorthand #909

Description

@asilano

Given this ERB file:

<%= content_tag :div, data: %>
<%= content_tag :div %>

the linter fails with the following offence:

[error] expect_eol_after_statement: unexpected symbol literal, expecting end-of-input (RUBY_PARSE_ERROR) (parser-no-errors)

test.html.erb:2:16

      1 │ <%= content_tag :div, data: %>
  →   2 │ <%= content_tag :div %>
        │                 ~
      3 │

If the first line either uses parentheses around its argument (<%= content_tag(:div, data:) %>), or specifies the hash value (<%= content_tag :div, data: data %>), then the file lints cleanly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingparser

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions