Erblint
From FVue
Problem
How to enable erb-lint in Vim?
Solution
group :development do gem 'better_html' # Makes automatic linting, fixing and autocompletion for Ruby possible in Vim # Add to .vimrc g:ale_linters: 'eruby': ['erblint'] gem 'erb_lint', require: false end
Add to .vimrc g:ale_linters:
let g:ale_linters = { ... \ 'eruby': ['erblint'], ... \} " Autofix, if preferred: let g:ale_fixers = { ... \ 'eruby': ['erblint'], ... \}
Create a file .erb-lint.yml:
--- EnableDefaultLinters: true linters: ErbSafety: enabled: true 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 # Naming this RuboCop module (regardless of its value true/false, # refrains Rubocop from working? — FVu, Jun 29, 2023 #Rails/OutputSafety: # Enabled: false
Create a file .rubocop.yml
Metrics/BlockLength: Max: 250 Exclude: - 'Rakefile' - '**/*.rake' - '**/admin/*.rb' - '*/admin/**/.rb' Style/Documentation: Enabled: false