Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ERBLint to a new rails 7.2 app with .erb-lint.yml from Readme results in a parsing error when running erblint #359

Open
sebastianiorga opened this issue Jul 16, 2024 · 0 comments

Comments

@sebastianiorga
Copy link

I made a fresh rails app 7.2 and just added erb_lint and better_html to it. When I run bundle exec erblint I get

warning: parser/current is loading parser/ruby33, which recognizes 3.3.4-compliant syntax, but you are running 3.3.3.
Please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
error parsing config: (.erb-lint.yml): mapping values are not allowed in this context at line 2 column 8

I played around a bit and this error replicates when doing YAML.safe_load(File.read(FILE_PATH)) but it parses fine when doing YAML.safe_load_file(FILE_PATH). Even if I monkeypatch the gem use safe_load_file there are then more errors that don't really make sense(it complains about deep_stringify_keys being missing but I see you are loading activesupport...)

Versions and yml files

better_html (2.1.1)
erb_lint (0.5.0)
rails (7.2.0.beta3)
ruby-3.3.3
Ubuntu 20.04.6 LTS in WSL2, running commands via zsh

# .erb-lint.yml
---
linters:
  ErbSafety:
    enabled: true
  Rubocop:
    enabled: true
    rubocop_config:
      inherit_from:
        - .rubocop.yml
  BetterHtml:
    enabled: true



# .better-html.yml
allow_single_quoted_attributes: false



# .rubocop.yml
# Omakase Ruby styling for Rails
inherit_gem: { rubocop-rails-omakase: rubocop.yml }

# Overwrite or add rules to create your own house style
#
# # Use `[a, [b, c]]` not `[ a, [ b, c ] ]`
# Layout/SpaceInsideArrayLiteralBrackets:
#   Enabled: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant