Rule: erb-comment-syntax
Disallow ERB tags that start with <% # (with a space before the #). Use the ERB comment syntax <%# instead.
Ruby comments starting immediately after an ERB tag opening (e.g., <% # comment %>) can cause parsing issues in some contexts. The proper ERB comment syntax <%# comment %> is more reliable and explicitly designed for comments in templates.
For multi-line comments or actual Ruby code with comments, ensure the content starts on a new line after the opening tag.
<%# This is a proper ERB comment %>
<%
# This is a proper ERB comment
%>
<%
# Multi-line Ruby comment
# spanning multiple lines
%><% # This should be an ERB comment %>
<%= # This should also be an ERB comment %>
<%== # This should also be an ERB comment %>