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

Allow way to inherit ERBLint configs from other gems #317

Open
khiga8 opened this issue Apr 12, 2023 · 1 comment
Open

Allow way to inherit ERBLint configs from other gems #317

khiga8 opened this issue Apr 12, 2023 · 1 comment

Comments

@khiga8
Copy link
Collaborator

khiga8 commented Apr 12, 2023

The same way that Rubocop supports inheriting configs from a gem, it would be nice if ERBLint supported inheriting ERBLint configs from a gem.

@khiga8
Copy link
Collaborator Author

khiga8 commented Jun 9, 2023

I noticed there is actually existing code in runner_config_resolver that actually allow us to inherit erb-lint configs from other gems.

Based on the example shown in the README, I thought inherit_gem only works for inheriting Rubocop configs , but this seems to work too:

---
EnableDefaultLinters: true
inherit_gem:
  custom-erblint-gem: config/default.yml

This is a setup where my dependency gem, "custom-erblint-gem" has a yml config in the path config/default.yml. It looks like the resulting config is what we want, with the configs in config/default.yml deep merged.

However, linter_registry.rb only has access to rules included in the custom directory .erb-linters. I think we'd want it to automatically pull in ERB lint rules that are defined in the gem specified in inherit_gem.

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