Skip to content

Add Herb linter for ERB templates - #1721

Open
jcoyne wants to merge 2 commits into
mainfrom
herb-lint
Open

jcoyne wants to merge 2 commits into
mainfrom
herb-lint

Conversation

@jcoyne

@jcoyne jcoyne commented Dec 3, 2026

Copy link
Copy Markdown
Member

Adds Herb's linter (@herb-tools/linter) to check our ERB templates, and runs it in CI alongside rubocop and eslint.

  • rake herb task, also added to the default rake task and the CI lint job
  • yarn lint:erb script
  • .herb.yml with framework: actionview

The first run reported ~100 offenses. The 16 rules with offenses are disabled in .herb.yml (like .rubocop_todo.yml) so they can be fixed and re-enabled one at a time; ~80 are autocorrectable with herb-lint --fix.

The linter also caught a stray closing </div> inside the <tr> in DocumentCollectionContextComponent, which is removed here. Browsers already discarded it, so there's no visible change.

Rules with existing offenses are disabled in .herb.yml so they can be
fixed and re-enabled incrementally. Also removes a stray closing </div>
in DocumentCollectionContextComponent found by the linter.
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

Successfully merging this pull request may close these issues.

1 participant