stormwarning / tailwindcss-opentype

🔡 Tailwind CSS utility classes for advanced typographic features.
https://tailwindcss-opentype.netlify.app
ISC License
32 stars 2 forks source link

Type errors when using in tailwind.config.mjs #94

Open joeldbirch opened 1 year ago

joeldbirch commented 1 year ago

Hello, nice looking plugin, thank you!

I'm getting errors when attempting to add this plugin to my tailwind.config.mjs file. I assume it's something incompatible with the CommonJS format of the imported file.

// @ts-check
import opentype from 'tailwindcss-opentype'

// ...
{
  // ... rest of config here

  plugins: [
    opentype
  ]
}

The error is:

Type 'typeof import("/some/path/node_modules/tailwindcss-opentype/dist/index")' is not assignable to type 'PluginCreator | { handler: PluginCreator; config?: Partial<Config>; } | { (options: any): { handler: PluginCreator; config?: Partial<...>; }; __isOptionsFunction: true; }'.ts(2322)
stormwarning commented 1 year ago

@joeldbirch Thanks, nice to know someone else finds it useful!

I didn't realise Tailwind allowed JS module config formats now, I'll look into this...