Shopify / erb-lint

Lint your ERB or HTML files
MIT License
592 stars 113 forks source link

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

Closed TastyPi closed 11 months ago

TastyPi commented 11 months 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 11 months ago

Ah this is a duplicate #228