What version of prettier-plugin-tailwindcss are you using?
v0.1.9
What version of Tailwind CSS are you using?
v3.0.24
What version of Node.js are you using?
v16.13.0
What package manager are you using?
npm
What operating system are you using?
Windows
Reproduction URL
https://github.com/bennettdams/tailwind-prettier-whitespace-bug
Describe your issue
Version v0.1.9 introduced a change for frameworks like React that will introduce "bugs".
Here is a basic example. When a class consists of multiple concatenated strings, the plugin now removes the leading whitespace:
function Test() {
- return <div className={"text-white" + " bg-red-100"} />;
+ return <div className={"text-white" + "bg-red-100"} />;
}
I use this format of concatenated strings for visibility when there are a lot of classes, e.g.:
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'
}
What version of
prettier-plugin-tailwindcssare you using?v0.1.9What version of Tailwind CSS are you using?
v3.0.24What version of Node.js are you using?
v16.13.0What package manager are you using?
npm
What operating system are you using?
Windows
Reproduction URL
https://github.com/bennettdams/tailwind-prettier-whitespace-bug
Describe your issue
Version
v0.1.9introduced a change for frameworks like React that will introduce "bugs".Here is a basic example. When a class consists of multiple concatenated strings, the plugin now removes the leading whitespace:
function Test() { - return <div className={"text-white" + " bg-red-100"} />; + return <div className={"text-white" + "bg-red-100"} />; }I use this format of concatenated strings for visibility when there are a lot of classes, e.g.: