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

over-aggressive whitespace removal #328

Open
happycollision opened this issue Nov 4, 2024 · 0 comments
Open

over-aggressive whitespace removal #328

happycollision opened this issue Nov 4, 2024 · 0 comments
Assignees

Comments

@happycollision
Copy link

happycollision commented Nov 4, 2024

What version of prettier-plugin-tailwindcss are you using?

v0.6.8

What version of Tailwind CSS are you using?

v3.4.3

What version of Node.js are you using?

v22.3.0

What package manager are you using?

pnpm (first noticed when using npm, though)

What operating system are you using?

macOS

Reproduction URL

tag: https://github.com/happycollision/repro-tw-plugin-problems/releases/tag/over-aggressive-whitespace-removal
browse at tag: https://github.com/happycollision/repro-tw-plugin-problems/tree/0b76817425c40fc63874c8c82e6e7e67eb9b3dae

The readme explains the same thing as this issue

Describe your issue

Here's the diff on an example component when you run the plugin:

 export default function Example() {
   const a = "size-12"
   const b = "border border-black"
 
   return (
     <>
-      <div className={a + " p-4 " + b}></div>
+      <div className={a + " p-4" + b}></div>
       <div className={`${a} p-4 ${b}`}></div>
     </>
   )
 }

You can see that the plugin doesn't consider trailing whitespace with +-style concatenation to be important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants