-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
.erb format support #371
Comments
Yeah absolutely! Still working on how to make that work exactly. Currently there isn't a lot of support for templating languages in general. There's some discussion going on w/r/t prettier as a whole, so I'm following that. |
You may bind types "*.html.erb" as "html" but erb tags like will formatting to |
Okay I dug into this a ton today and here's what I've determined: ERB support is going to be hard. There are a couple of options, I'm going to lay them out here:
Regardless, I'm going to table this issue for now. I just don't have the bandwidth to work on it right now. I'd be super happy if anyone wanted to really dig into this - I'm sure it would be a rewarding endeavor. Hopefully I'll be able to come back to it at some point. |
Just for bookkeeping purposes I'm going to close this issue. I talk a little about it in the wiki https://github.com/prettier/plugin-ruby/wiki#do-you-support-erb-files-htmlerb-jserb-etc, and I'm talking to prettier core members about it. Hopefully we'll have something to look at in the future. |
@kddeisz that link is dead (the wiki seems to be inaccessible or gone). Did you post it anywhere else? |
@bbugh it's here: https://github.com/prettier/plugin-ruby/blob/master/CONTRIBUTING.md#do-you-support-erb-files-htmlerb-jserb-etc I think it was a mistake. |
Would still love to see this in Prettier. It would allow us to reduce the number of formatters we have in our project by 1 which is always great. |
What are you currently using to format erb?
On Tue, Oct 6, 2020 at 11:23 AM Alan Savage ***@***.***> wrote:
Would still love to see this in Prettier. It would allow us to reduce the
number of formatters we have in our project by 1 which is always great.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#371 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABG3P3S4LAIX3KEM6SRBOXTSJMY5PANCNFSM4IKMSYHA>
.
--
*Kevin D. Deisz*
Staff Production Engineer
Shopify <https://www.shopify.com/>
|
Rufo
…On Tue, Oct 6, 2020, 10:22 AM Kevin Deisz ***@***.***> wrote:
What are you currently using to format erb?
On Tue, Oct 6, 2020 at 11:23 AM Alan Savage ***@***.***>
wrote:
> Would still love to see this in Prettier. It would allow us to reduce the
> number of formatters we have in our project by 1 which is always great.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <
#371 (comment)
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/ABG3P3S4LAIX3KEM6SRBOXTSJMY5PANCNFSM4IKMSYHA
>
> .
>
--
*Kevin D. Deisz*
Staff Production Engineer
Shopify <https://www.shopify.com/>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#371 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APRKQYSSKKCUXMIWFOEN2GLSJNG6HANCNFSM4IKMSYHA>
.
|
Nice! I didn’t know Rufo had support for ERB. I’ll have to check out how
they do it
On Tue, Oct 6, 2020 at 1:37 PM Alan Savage ***@***.***> wrote:
Rufo
On Tue, Oct 6, 2020, 10:22 AM Kevin Deisz ***@***.***>
wrote:
> What are you currently using to format erb?
>
> On Tue, Oct 6, 2020 at 11:23 AM Alan Savage ***@***.***>
> wrote:
>
> > Would still love to see this in Prettier. It would allow us to reduce
the
> > number of formatters we have in our project by 1 which is always great.
> >
> > —
> > You are receiving this because you were mentioned.
> > Reply to this email directly, view it on GitHub
> > <
>
#371 (comment)
> >,
> > or unsubscribe
> > <
>
https://github.com/notifications/unsubscribe-auth/ABG3P3S4LAIX3KEM6SRBOXTSJMY5PANCNFSM4IKMSYHA
> >
> > .
> >
> --
> *Kevin D. Deisz*
> Staff Production Engineer
> Shopify <https://www.shopify.com/>
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <
#371 (comment)
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/APRKQYSSKKCUXMIWFOEN2GLSJNG6HANCNFSM4IKMSYHA
>
> .
>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#371 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABG3P3UGPHR2HZEBXPUC5N3SJNIWDANCNFSM4IKMSYHA>
.
--
*Kevin D. Deisz*
Staff Production Engineer
Shopify <https://www.shopify.com/>
|
Just FYI, I use https://github.com/threedaymonk/htmlbeautifier which works ok. |
I think it's really close actually! It does not seem to be breaking our HTML at all, just a few small styling nits and i think this could be shipped. Formatting Inline RubyA: If we format a file with this content: <%= render partial: 'shared/search_header', locals: { search_url: routes.retailers_path } %>
<%= form %> B: Prettier will output: <%= render partial: 'shared/search_header', locals: { search_url: routes.retailers_path } %> <%= form %> This isn't wrong; it's fully syntactically valid. However, I think the A output looks better. Would it make sense to treat the inline ruby |
not working on vim. not sure what's wrong. |
https://github.com/adamzapasnik/prettier-plugin-erb currently doesn't support prettier 2.3+ which is kind of a deal breaker for me unfortunately. |
Wondering if there's any plans for this plugin to support
.erb
format?Prettier already supports
.html
format but if passed.html.erb
it fails.The text was updated successfully, but these errors were encountered: