Shopify / erb-lint

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

False positive for PartialInstanceVariable in ERB comment? #315

Open steveclarke opened 1 year ago

steveclarke commented 1 year ago

When my .erb-lint.yml contains:

linters:
  PartialInstanceVariable:
    enabled: true

and I have the following commented-out line in my _form.html.erb file:

<%#= debug_json @employer.contracts %>

erblint app/views/configuration/employers/_form.html.erb reports:

Linting 1 files with 16 linters...

Instance variable detected in partial.
In file: app/views/configuration/employers/_form.html.erb:195

It's nice that erblint warns me that, should I uncomment the code, it would trigger an issue, but is this expected behaviour? I would have expected erblint to ignore anything in comments. What if I wanted to use that comment to say what not to write?