Skip to content

Config interface is not exported #161

@AndyClausen

Description

@AndyClausen

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:
image

The interface exists here but is not being exported to dist.

I'd like to be able to do something like this:

/** @type {import("prettier").Config & import("prettier-plugin-tailwindcss")} */
const config = {
  plugins: [require.resolve("prettier-plugin-tailwindcss")],
  tailwindAttributes: ['myClassList'],
};

module.exports = config;

A workaround for now is to recreate the interface or make it inline when needed like this:

/** @type {import("prettier").Config & {tailwindAttributes: string[]}} */

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions