What version of prettier-plugin-tailwindcss are you using?
0.6.9
What version of Tailwind CSS are you using?
3.4.1
What version of Node.js are you using?
22.21.1
What package manager are you using?
pnpm
What operating system are you using?
macOS
Reproduction URL
https://github.com/danteissaias/prettier-plugin-tailwindcss-bug-repro
Describe your issue
Given the following code:
className={classNames(
"bg-red-500",
value.includes("\n") ? "pt-2" : "pt-1"
)}
The classes are already properly sorted. However, when formatting with prettier-plugin-tailwindcss, the \n character inside .includes() is removed. This results in the following code:
className={classNames(
"bg-red-500",
value.includes(" ") ? "pt-2" : "pt-1"
)}
Expected behavior: Prettier should not remove the newline character.
What version of
prettier-plugin-tailwindcssare you using?0.6.9
What version of Tailwind CSS are you using?
3.4.1
What version of Node.js are you using?
22.21.1
What package manager are you using?
pnpm
What operating system are you using?
macOS
Reproduction URL
https://github.com/danteissaias/prettier-plugin-tailwindcss-bug-repro
Describe your issue
Given the following code:
The classes are already properly sorted. However, when formatting with
prettier-plugin-tailwindcss, the\ncharacter inside.includes()is removed. This results in the following code:Expected behavior: Prettier should not remove the newline character.