prettier-plugin-erb
prettier-plugin-erb copied to clipboard
Why add whitespace between % and # in comments?
This plugin adds whitespace between <%
and #
in comments, like this <% # Comment %>
. In the old days, whitespace before the #
was not only actively discouraged, but would potentially screw up HTML rendering. The most correct syntax was <%# Comment %>
. This is also the syntax examples in the official Rails API to this day. I hadn't even seen the whitespace variant until today.
More subjective data point: I find the whitespace makes the file harder to parse with my eyes. I'm used to looking for the character following the %
. Whitespace means ruby block, =
means output/render, and #
means comment. Having whitespace in comments too makes it harder to scan.
Is there a different reason for this standard I don't know about?
hey @evenreven that's a bug, thanks for reporting it.
should be fixed in a newly released v0.2.0