Improving Prettier Tailwind Plugin for .templ
Files
#120
Closed
cl3mcg
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Dear all,
I recently discovered this repository:
prettier-plugin-tailwindcss-extra
This plugin enhances Prettier's ability to understand
.templ
files and format Tailwind CSS classes properly. Integrating it into your project is straightforward; just follow these steps:Install the necessary packages:
Add the plugins to your
prettier.config.js
orprettier.config.json
file:Additionally, you can modify your npm or bun scripts to run
prettier --write .
before the Parcel build actions. Here's an example of how you can set this up:When Air kicks in, it triggers a
bun run build
command that formats the code according to Prettier before proceeding with the rest of the actions. This ensures that, thanks toprettier-plugin-tailwindcss-extra
, the code is properly formatted even though.templ
files are not directly supported by Prettier.I would like to contribute this enhancement via a pull request, but I'm unsure where to add this command and the extra plugins within the Gowebly CLI actions/functions. Any guidance on this would be greatly appreciated.
Best regards,
Beta Was this translation helpful? Give feedback.
All reactions