You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using prettier in a project that uses daisyui and prettier-plugin-tailwindcss, the daisyui header is added to the prettier output. This ends up in the file I'm trying to format.
I'll add that the problem only happens for me when using the prettier inside node_modules/.bin and not when using a globally installed prettier. If I uninstall prettier-plugin-tailwindcss the problem stops.
This seems to be a specific bad interaction between daisyui and prettier-plugin-tailwindcss.
Prettier version 2.6.2 (both the on inside node_modules and the globally installed)
DaisyUI version 2.15.0
What I've tried so far
Reinstalling prettier
Updating prettier and daisyui to latest versions
Other considerations
It boggles me that it doesn't happen with the prettier I installed with homebrew...
This is not something I can fix on my end. daisyUI just has console.logs in this file and it's meant to be printed on terminal after building the CSS, to inform the developer about the stuff daisyUI is adding. It should only be on the terminal (because it's just a console.log) and should not be added to the output file.
A workaround is to disable daisyUI logs from tailwind.config.js:
If I call prettier with prettier -w, the header will be shown on the terminal and the correct formatted content will be written to the file. So I think prettier can distinguish the two kinds of output (obviously console.log will not write to any file), I would like to ask, how can I call prettier to get the formatted content only? I'm using a plugin to call prettier in neovim, and I'm finding a way to make it get the correct formatted content.
What's happening
When using prettier in a project that uses
daisyui
andprettier-plugin-tailwindcss
, the daisyui header is added to the prettier output. This ends up in the file I'm trying to format.I'll add that the problem only happens for me when using the prettier inside
node_modules/.bin
and not when using a globally installed prettier. If I uninstallprettier-plugin-tailwindcss
the problem stops.This seems to be a specific bad interaction between daisyui and prettier-plugin-tailwindcss.
Prettier version 2.6.2 (both the on inside node_modules and the globally installed)
DaisyUI version 2.15.0
What I've tried so far
Other considerations
It boggles me that it doesn't happen with the prettier I installed with homebrew...
This person is having the same issue:
tailwindlabs/tailwindcss#8380
The text was updated successfully, but these errors were encountered: