prettier-plugin-tailwindcss icon indicating copy to clipboard operation
prettier-plugin-tailwindcss copied to clipboard

over-aggressive whitespace removal

Open oliviertassinari opened this issue 11 months ago • 1 comments

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

v0.6.9

What version of Tailwind CSS are you using?

v3.4.17

What package manager are you using?

pnpm

Reproduction URL

import * as React from 'react';

const isExtendable = false;

export default function BasicAlerts() {
  return (
    <div
      className={`MuiApi-item-root${isExtendable ? ' MuiApi-item-header-extendable' : ''}`}
    />
  );
}

Describe your issue

The above code snippet is converted into:

-      className={`MuiApi-item-root${isExtendable ? ' MuiApi-item-header-extendable' : ''}`}
+      className={`MuiApi-item-root${isExtendable ? 'MuiApi-item-header-extendable' : ''}`}

This is similar to #328.

One workaround in the meantime is to add // prettier-ignore.


Off-topic Adding this plugin increase prettier run time by 44%.

oliviertassinari avatar Dec 27 '24 20:12 oliviertassinari

I'll look into this soon.

Off-topic Adding this plugin increase prettier run time by 44%

I'm not surprised it increases the time it takes to run Prettier but I am surprised it's by this much wow. I'll have to take a look at this too. 😱

thecrypticace avatar Jan 06 '25 15:01 thecrypticace

This will be fixed once 0.7.0 is out 👍

re: the performance problem I generally don't see that kind of slowdown. Would like to look at a project where you see this though if you can provide access to one.

thecrypticace avatar Sep 02 '25 14:09 thecrypticace