-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix prettier importOrderSeparation not working #1796
Fix prettier importOrderSeparation not working #1796
Conversation
@denik1981 is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
I believe this PR is still relevant despite the new turbo addition into the stack, but please put this on pause until I ran a second test with the new structure of the repo. |
The problem is that If we remove the plugin declaration, the tailwind classes aren't sorted. You can try yourself locally. |
The problem is actually an incompatibility issue between tailwindlabs/prettier-plugin-tailwindcss#9 Leaving |
btw, regarding #1791, why it is necessary to vc prisma/zod files if they are fully generated in the post installation step by prisma? Can we gitignore them? |
tailwindlabs/prettier-plugin-tailwindcss#31 (comment) this seems to at least hotfix it |
Fair point @denik1981 we would probably just prettier ignore those files |
Ok, I will try it to see how it works and push it today. |
This pull request is being automatically deployed with Vercel (learn more). docs – ./apps/docs🔍 Inspect: https://vercel.com/cal/docs/5fNu4jpuTenvB1zBZNrsGrLn4566 [Deployment for de5416c canceled] calendso – ./apps/web🔍 Inspect: https://vercel.com/cal/calendso/qZnBS5dyezQmVkhYNu3fDTcFw6zr |
@zomars Thanks! This (below) is an emulation in an isolated nextjs app with all the Cal settings for prettier and eslint and tests added to it.
The reason I delayed this PR is because the hotfix throw me an error that I was not able to reproduce anymore.
|
oh whats the best way moving forward? @zomars |
That's odd. I can't seem to replicate locally. Will investigate further. |
* Fix prettier importOrderSeparation not working * Solves prettier plugin conflict Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: zomars <[email protected]>
* Fix prettier importOrderSeparation not working * Solves prettier plugin conflict Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: zomars <[email protected]>
What does this PR do?
Prettier's configuration file is wrongly composed adding the Tailwind Plugin in a declarative way within the plugin key. Prettier mentions that third-party plugins are automatically loaded if they have been installed in the same node_modules folder and follow the name of
@prettier/<plugin>
orprettier-plugin-<plugin>
(prettier-on-how-to-add-third-party-plugins)Placing a
plugin
key withinprettierrc.js
causes a not expected behavior because despite prettier actually runs, it fails on applying certain rules, beingimportOrderSeparation
one of them. A clear side effect for this is within issue #1791 where a missing space between the first import in all theprisma/zod/*
files is causing all of them to differ from HEAD when they are regenerated by prisma (and later formatted by prettier)Fixes # (1791)
Type of change
How should this be tested?
Test A
Checklist: