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
Hey! Thanks for that repo. The problem is definitely that ts-to-zod is using Prettier 2 to do some formatting internally, we only support Prettier v3, and they're both using your config file (plus Prettier v2 autoloads plugins by default so even without the config it'd still break):
That said, I did figure out a workaround but it requires a super strange setup for the config to stop v2 from loading prettier-plugin-tailwindcss while still allowing ts-to-zod to use Prettier and your config.
You'll want to customize your prettier config such that:
Prettier v2 autoloading is disabled — otherwise the plugin will always be picked up because of the package name and you'll keep getting the error
Configure Prettier to only load the plugin for files matching app/*. You do this via the overrides key in your config.
This setup looks like this:
/** @type {import('prettier').Config} */module.exports={// Stop autoloading in Prettier v2// This is a warning in Prettier v3// but you can safely ignore itpluginSearchDirs: [],overrides: [// Only load `prettier-plugin-tailwindcss` when scanning the app dir// This _should_ work so long as `ts-to-zod` doesn't run prettier on any files in `app/*`{files: ["app/*"],options: {plugins: ["prettier-plugin-tailwindcss"],},},],};
So, unfortunately nothing we can do to fix this on our end but the above Prettier config might fix things for you. Hope that helps! ✨
Versions
Typescript: v5.1.6
Zod: v3.1.3
The text was updated successfully, but these errors were encountered:
martitv
changed the title
ts-to-zod is unsing Prettier v2 which autoloads configs and causes errors due to unsupported plugins
ts-to-zod is using Prettier v2 which autoloads configs and causes errors due to unsupported plugins
Sep 19, 2023
Bump!
Prettier-plugin-tailwindcss is a super important plugin for using tailwind! Please fix this so it is possible to use both of these libraries at the same time!
Bug description
Ref this issue: #tailwindlabs/prettier-plugin-tailwindcss#214
Versions
v5.1.6
v3.1.3
The text was updated successfully, but these errors were encountered: