Skip to content

Linter: Implement erb-closing-tag-indent rule#1445

Open
markokajzer wants to merge 1 commit intomarcoroth:mainfrom
markokajzer:marko/closingtagindent
Open

Linter: Implement erb-closing-tag-indent rule#1445
markokajzer wants to merge 1 commit intomarcoroth:mainfrom
markokajzer:marko/closingtagindent

Conversation

@markokajzer
Copy link
Contributor

@markokajzer markokajzer commented Mar 21, 2026

closes #555

Linter Rule: Enforce consistent closing ERB tag indentation

Rule: erb-closing-tag-indent

Description

This rule enforces that the closing ERB tag (%>) is consistently indented relative to its opening tag (<% or <%=). When an ERB tag spans multiple lines, the closing %> must be on its own line and indented to match the column position of the opening tag.

Rationale

Inconsistent indentation of closing ERB tags makes templates harder to read and maintain. When an ERB tag spans multiple lines, the closing %> should visually align with the opening <% to clearly show the tag boundaries. Conversely, if the opening tag is on the same line as the content, the closing tag should also be on the same line.

@markokajzer markokajzer changed the title Linter: Add erb-closing-tag-indent rule Linter: Implement erb-closing-tag-indent rule Mar 21, 2026
@markokajzer markokajzer force-pushed the marko/closingtagindent branch 6 times, most recently from fcc9099 to e79f27c Compare March 24, 2026 00:28
@markokajzer markokajzer force-pushed the marko/closingtagindent branch from e79f27c to 510233b Compare March 24, 2026 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

erb-lint: ClosingErbTagIndent

1 participant