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
Currently, types are not being exported. This means you can't extend your prettier config with the added properties (such as tailwindAttributes) without getting type errors.
Here is the error you'll get:
The interface exists here but is not being exported to dist.
I've merged in #162 which adds exported types for the Prettier config. This will be available in our next tagged release. In the meantime you can test it now by installing our insiders build:
npm install prettier-plugin-tailwindcss@insiders
One note, at least in my setup, a require() call is necessary for the prettier config options to show up. Neither the string or require.resolve versions of the config will enable typescript to pick up the config. So my config looked like this:
But this way, you'll need to add tailwindAttributes and tailwindFunctions since they're not optional in the interface. Idk if they should be, but just a heads-up :)
What version of
prettier-plugin-tailwindcss
are you using?v0.3.0
What version of Tailwind CSS are you using?
v3.3.2
What version of Node.js are you using?
v18.x
What package manager are you using?
npm
What operating system are you using?
Windows
Reproduction URL
https://replit.com/@AndyClausen/EagerAdvancedExternalcommand#prettier.config.js
Describe your issue
Currently, types are not being exported. This means you can't extend your prettier config with the added properties (such as
tailwindAttributes
) without getting type errors.Here is the error you'll get:
The interface exists here but is not being exported to dist.
I'd like to be able to do something like this:
A workaround for now is to recreate the interface or make it inline when needed like this:
/** @type {import("prettier").Config & {tailwindAttributes: string[]}} */
The text was updated successfully, but these errors were encountered: