Skip to content

Fix herb linter offenses in ERB templates - #1645

Merged
tompng merged 1 commit into
masterfrom
fix-herb-linter-offenses
Mar 14, 2026
Merged

Fix herb linter offenses in ERB templates#1645
tompng merged 1 commit into
masterfrom
fix-herb-linter-offenses

Conversation

@st0012

@st0012 st0012 commented Mar 14, 2026

Copy link
Copy Markdown
Member

Summary

  • Remove then keyword from all ERB control flow tags (52 offenses)
  • Move duplicated HTML elements outside conditional branches (14 offenses)
  • Add .herb.yml config to disable rules not applicable to RDoc:
    • erb-no-instance-variables-in-partials — RDoc templates aren't Rails partials
    • erb-no-unsafe-script-interpolation — templates render trusted RDoc data
    • erb-no-output-in-attribute-position — same reason

Fixes CI failure caused by @herb-tools/linter 0.9.0 introducing new rules.

- Remove `then` keyword from all ERB control flow tags (52 offenses)
- Move duplicated elements outside conditional branches (14 offenses)
- Add .herb.yml to disable rules not applicable to RDoc templates:
  erb-no-instance-variables-in-partials (not Rails partials),
  erb-no-unsafe-script-interpolation (trusted data),
  erb-no-output-in-attribute-position (trusted data)
@matzbot

matzbot commented Mar 14, 2026

Copy link
Copy Markdown
Collaborator

🚀 Preview deployment available at: https://3bf415c6.rdoc-6cd.pages.dev (commit: 3af977b)

@st0012
st0012 marked this pull request as ready for review March 14, 2026 14:10
@tompng
tompng merged commit 1bacf79 into master Mar 14, 2026
78 checks passed
@tompng
tompng deleted the fix-herb-linter-offenses branch March 14, 2026 15:44
k0kubun pushed a commit that referenced this pull request May 12, 2026
- Remove `then` keyword from all ERB control flow tags (52 offenses)
- Move duplicated HTML elements outside conditional branches (14
offenses)
- Add `.herb.yml` config to disable rules not applicable to RDoc:
- `erb-no-instance-variables-in-partials` — RDoc templates aren't Rails
partials
- `erb-no-unsafe-script-interpolation` — templates render trusted RDoc
data
  - `erb-no-output-in-attribute-position` — same reason

Fixes CI failure caused by `@herb-tools/linter` 0.9.0 introducing new
rules.
k0kubun pushed a commit that referenced this pull request May 12, 2026
- Remove `then` keyword from all ERB control flow tags (52 offenses)
- Move duplicated HTML elements outside conditional branches (14
offenses)
- Add `.herb.yml` config to disable rules not applicable to RDoc:
- `erb-no-instance-variables-in-partials` — RDoc templates aren't Rails
partials
- `erb-no-unsafe-script-interpolation` — templates render trusted RDoc
data
  - `erb-no-output-in-attribute-position` — same reason

Fixes CI failure caused by `@herb-tools/linter` 0.9.0 introducing new
rules.
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.

3 participants