barvian / fluid-tailwind

Build better responsive designs in less code.
https://fluid.tw
MIT License
1.24k stars 19 forks source link

TypeScript TS2322: Type is not assignable to type PluginCreator #32

Closed boar-is closed 5 months ago

boar-is commented 5 months ago
import fluid, { extract } from 'fluid-tailwind'
import type { Config } from 'tailwindcss'

const configExample = {
  content: [],
  plugins: [fluid], // type error at `fluid`
} satisfies Config

Note the Config type.

image

package.json

{
  "tailwindcss": "3.4.4",
  "fluid-tailwind": "1.0.0",
  "typescript": "5.4.5"
}

tsconfig.json

{
  "compilerOptions": {
    "target": "ES6",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "noEmit": true,
    "exactOptionalPropertyTypes": true,
    "noImplicitOverride": true,
    "noImplicitReturns": true,
    "noPropertyAccessFromIndexSignature": true,
    "noUncheckedIndexedAccess": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "bundler",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "plugins": [
      {
        "name": "next"
      }
    ],
    "paths": {
      "~/*": ["./*"]
    }
  },
  "include": ["**/*", ".*/**/*", ".next/types/**/*.ts"],
  "exclude": ["node_modules", ".next"]
}
barvian commented 5 months ago

Hi, thanks for filing. Which version of TypeScript are you using? I'm not able to reproduce this locally (also using PNPM and the versions of Tailwind and the plugin you listed).

boar-is commented 5 months ago

I updated the issue so that it contains TypeScript version and tsconfig.

barvian commented 5 months ago

I just pushed v1.0.1 which hopefully fixes this. Feel free to re-open if you're still seeing issues!