prettier-plugin-eex
prettier-plugin-eex copied to clipboard
Eex expressions converted to eextN
Deired Behaviour
format not only HTML but also eex/leex
expression without buggy convertions
ActualBehaviour All eex/leex expressions are converted to eextN where N is the "index" of expression. So you if you have 3 expression into a template, they will be converted to:
eext1 eext2 eext3
Versions
elixir: v1.12.1
erlang/OTP: v24.0.0
node: v12.22.1
yarn: v1.221
prettier: v2.2.1
prettier-plugin-eex: v0.5.0
Screenshots
@adamzapasnik any thoughts on what a fix might look like here?
Here's a minimal testcase:
Before:
<textarea>
<%= @something %>
</textarea>
After:
<textarea>
<eext1 />
</textarea>
Apart from this issue, I'm really loving this plugin. Thank you!
Ah, it looks like we need to lock to prettier 2.2 for now: https://github.com/adamzapasnik/prettier-plugin-eex/issues/51
EDIT: actually, that doesn't work for me either. Commented on #51
hey guys, apologies for my absence.
These are bugs not related to prettier, I'll fix them along with a migration to 2.3 prettier.
This can take a while, though. So for now, you'll have to ignore these files 😓
This same issue happens to me on a fresh install of prettier 2.2.1 and prettier-plugin-eex 0.4 with no prettierrc
May be related but I'm having this happen to files only when I add ` at the top of the file.
Before format:
<!-- prettier-ignore -->
<div class="flex-1">
<p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p>
<p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p>
<%= @inner_content %>
</div>
After format:
<!-- prettier-ignore -->
<div class="flex-1">
<p class="alert alert-info" role="alert"> <eext1 /> </p>
<p class="alert alert-danger" role="alert"> <eext2 /> </p>
<eext3 />
</div>
Without the prettier ignore comment it works correctly.