Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eex expressions converted to eextN #59

Open
zoedsoupe opened this issue Jun 10, 2021 · 5 comments
Open

Eex expressions converted to eextN #59

zoedsoupe opened this issue Jun 10, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@zoedsoupe
Copy link

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
image

@semanticart
Copy link

@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!

@semanticart
Copy link

semanticart commented Jun 30, 2021

Ah, it looks like we need to lock to prettier 2.2 for now: #51

EDIT: actually, that doesn't work for me either. Commented on #51

@adamzapasnik adamzapasnik added the bug Something isn't working label Jul 1, 2021
@adamzapasnik
Copy link
Owner

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 😓

@dzfranklin
Copy link

This same issue happens to me on a fresh install of prettier 2.2.1 and prettier-plugin-eex 0.4 with no prettierrc

@cchauche
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants