Skip to content

Linter: Implement autofix for erb-no-output-control-flow - #2010

Merged
marcoroth merged 1 commit into
mainfrom
erb-no-output-control-flow-autofix
Aug 5, 2026
Merged

marcoroth merged 1 commit into
mainfrom
erb-no-output-control-flow-autofix

Conversation

@marcoroth

@marcoroth marcoroth commented Aug 5, 2026 •

Copy link
Copy Markdown
Owner

Follow up on #2008.

This pull request makes erb-no-output-control-flow autocorrectable. Now that the offense message spells out the exact replacement, the rule can also apply it. The fix is a single token mutation, <%= becomes <%, which covers every shape the rule reports: if, unless, elsif, else, end and iteration blocks.

- <%= if condition? %>
+ <% if condition? %>
    <p>Content</p>
- <%= elsif another_condition? %>
+ <% elsif another_condition? %>
    <p>Content</p>
- <%= end %>
+ <% end %>

@github-actions github-actions Bot added linter @herb-tools/linter for HTML+ERB templates typescript TypeScript source across the javascript/ packages linter-rule Individual linter rules and their documentation linter-autofix Linter autofix behavior labels Aug 5, 2026
@marcoroth marcoroth changed the title Linter: Make erb-no-output-control-flow autocorrectable Linter: Implement autofix for erb-no-output-control-flow Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

🌿 Interactive Playground and Documentation Preview

A preview deployment has been built for this pull request. Try out the changes live in the interactive playground:


🌱 Grown from commit 9930686


✅ Preview deployment has been cleaned up.

@pkg-pr-new

pkg-pr-new Bot commented Aug 5, 2026

Copy link
Copy Markdown
npx https://pkg.pr.new/@herb-tools/formatter@2010
npx https://pkg.pr.new/@herb-tools/language-server@2010
npx https://pkg.pr.new/@herb-tools/linter@2010

commit: 9930686

@marcoroth
marcoroth marked this pull request as ready for review August 5, 2026 11:05
@marcoroth
marcoroth merged commit 98275cd into main Aug 5, 2026
22 checks passed
@marcoroth
marcoroth deleted the erb-no-output-control-flow-autofix branch August 5, 2026 11:05

This branch was successfully deployed

1 active deployment
herb-tools (Preview) — 99306867 Deployed Aug 5, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

linter @herb-tools/linter for HTML+ERB templates linter-autofix Linter autofix behavior linter-rule Individual linter rules and their documentation typescript TypeScript source across the javascript/ packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant