Shopify / erb_lint

Lint your ERB or HTML files
MIT License
664 stars 122 forks source link

Line with only opening `<%=` gets deleted by Rubocop linter #326

Closed TastyPi closed 1 year ago

TastyPi commented 1 year ago

If I enable the Rubocop linter then any line that just has <%= (and whitespace) gets deleted, e.g.

<%=
  tag.div
%>

gets formatted as:

tag.div
%>

Here's the config:

.erb-lint.yml:

exclude:
  - "vendor/**/*"
linters:
  RequireInputAutocomplete:
    enabled: false
  Rubocop:
    enabled: true
    rubocop_config:
      inherit_from:
        - .rubocop.yml
      Layout/InitialIndentation:
        Enabled: false
      Layout/LineLength:
        Enabled: false
      Layout/TrailingEmptyLines:
        Enabled: false
      Layout/TrailingWhitespace:
        Enabled: false
      Naming/FileName:
        Enabled: false
      Style/FrozenStringLiteralComment:
        Enabled: false
      Lint/UselessAssignment:
        Enabled: false
      Rails/OutputSafety:
        Enabled: false

I can try to trim down our .rubocop.yml if needed.

TastyPi commented 1 year ago

Ah this is a duplicate #228