What version of prettier-plugin-tailwindcss are you using?
0.5.3
What version of Tailwind CSS are you using?
3.1.7
What version of Node.js are you using?
18.7.0
What package manager are you using?
npm
What operating system are you using?
macOS
Reproduction URL
https://github.com/hugovandevliert/prettier-plugin-tailwindcss-escaping-slashes
Steps:
npm i
npx prettier --write foo.tsx
git diff
Note: this reproduction repo uses different versions as those listed above.
Describe your issue
Escaping slashes in tailwind classes are stripped when used in combination with classNames.
Original code:
export default () => (
<span
className={classNames('md:p-2 m-1 m-3 p-4', "before:content-['\\ea53']")}
/>
);
After running npx prettier --write file_name.tsx:
export default () => (
<span
className={classNames('m-1 m-3 p-4 md:p-2', "before:content-['ea53']")}
/>
);
Note the missing \\.
What version of
prettier-plugin-tailwindcssare you using?0.5.3
What version of Tailwind CSS are you using?
3.1.7
What version of Node.js are you using?
18.7.0
What package manager are you using?
npm
What operating system are you using?
macOS
Reproduction URL
https://github.com/hugovandevliert/prettier-plugin-tailwindcss-escaping-slashes
Steps:
npm inpx prettier --write foo.tsxgit diffNote: this reproduction repo uses different versions as those listed above.
Describe your issue
Escaping slashes in tailwind classes are stripped when used in combination with classNames.
Original code:
After running
npx prettier --write file_name.tsx:Note the missing
\\.