Removes newline character in .includes() inside `classNames`

Author: danteissaiasCreated Dec 20, 2025Updated Feb 9, 2026

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:

typescript
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:

typescript
className={classNames(
  "bg-red-500",
  value.includes(" ") ? "pt-2" : "pt-1"
)}

Expected behavior: Prettier should not remove the newline character.

Source: tailwindlabs/prettier-plugin-tailwindcss