prettier-plugin-erb
prettier-plugin-erb copied to clipboard
Invalid erb output for long blocks
Prettier-plugin-erb currently sometimes split the do
from a block onto a new line, causing a syntax error:
ActionView::SyntaxErrorInTemplate - Encountered a syntax error while rendering template
Example input:
<%= link_to signout_path, class: "very-long-class-name-here-to-cause-line-break" do %>
Welcome
<% end %>
Output:
<%= link_to signout_path, class: "very-long-class-name-here-to-cause-line-break"
do %> Welcome <% end %>
Full error:
ActionView::SyntaxErrorInTemplate - Encountered a syntax error while rendering template: check <%= link_to signout_path, class: "very-long-class-name-here-to-cause-line-break"
do %> Welcome <% end %>:
app/views/layouts/application.html.erb:70
Hey @Pezmc thanks for submitting the issue, it will be fixed in the next release.
should be fixed in a newly released v0.2.0