Giter Club home page Giter Club logo

Comments (5)

karlhorky avatar karlhorky commented on June 11, 2024 10

@bradlc @adamwathan Any new plans for reintroducing this great feature? Maybe as a (default-off) option for the plugin as has been suggested by the community?

We've had a number of new duplicate whitespace commits creep into our codebase, hard to manually review these mistakes.

from prettier-plugin-tailwindcss.

thevuong avatar thevuong commented on June 11, 2024 3

I like the feature of eliminating repeated spaces as well as the same class names. The problem of long class names can be used clsx library. I hope the removed feature will reappear in the new version.

Before:

className={
  'inline-flex items-center' +
  ' rounded-md p-2 shadow-sm focus:outline-none focus:ring-2 focus:ring-purple-600 focus:ring-opacity-50' +
  ' bg-dlila text-white transition duration-75 ease-in-out hover:bg-dorange' +
  ' disabled:cursor-not-allowed disabled:bg-gray-200'
}

After:

className={clsx(
  'inline-flex items-center',
  'rounded-md p-2 shadow-sm focus:outline-none focus:ring-2 focus:ring-purple-600 focus:ring-opacity-50',
  'bg-dlila hover:bg-dorange text-white transition duration-75 ease-in-out',
  'disabled:cursor-not-allowed disabled:bg-gray-200',
)}

from prettier-plugin-tailwindcss.

stefanosandes avatar stefanosandes commented on June 11, 2024 2

This vscode plugin may be useful for anyone wanting to do so: https://github.com/heybourn/headwind

from prettier-plugin-tailwindcss.

dargmuesli avatar dargmuesli commented on June 11, 2024

For me it wants to replace this

function Test() {
-      :class="['button', ...(buttonClass ? [buttonClass] : [])].join(' ')"
+      :class="['button', ...(buttonClass ? [buttonClass] : [])].join('')"
}

... which is certainly not what I want 😅

from prettier-plugin-tailwindcss.

bradlc avatar bradlc commented on June 11, 2024

Thanks for reporting this @bennettdams! For now we have published a new release (v0.1.10) that removes the whitespace removal feature while we consider solutions to the issues you were seeing 👍

from prettier-plugin-tailwindcss.

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.