Git Product home page Git Product logo

Comments (4)

adamzapasnik avatar adamzapasnik commented on July 23, 2024

Hi. If I understand correctly, this is the (simplified) problem:

Input

<ul>

Output

<ul></ul>

And in your case </ul> is in another partial, so you don't want it to be appended here?

from prettier-plugin-erb.

leastbad avatar leastbad commented on July 23, 2024

Yes, exactly.

It's an atypical scenario, but not unthinkable.

FWIW, this behaviour is really handy for 99.5% of templates! But there's no hard rule that the DOM fragment expressed in an ERB template has to be closed at EOF.

from prettier-plugin-erb.

adamzapasnik avatar adamzapasnik commented on July 23, 2024

Actually, I have been aware of this issue 😅 But it's such a rare case that I didn't do anything about it.

Here is a related prettier issue: prettier/prettier#5665 It seems that we will have to come up with this option on our own.

I'm looking into possible solutions right now, but I don't think I will be able to release a fix this month. Expect it next month.

For now, just add the affected files to .prettierignore 🙇 Hopefully, it's not a deal breaker.

from prettier-plugin-erb.

leastbad avatar leastbad commented on July 23, 2024

Actually, .prettierignore is the fix, Adam. I'm serious.

Thank you for reminding me that it exists. This should be the way forward for this kind of weirdo edge case.

Have a great weekend, and thanks for this library.

from prettier-plugin-erb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.