flowbite-svelte-blocks icon indicating copy to clipboard operation
flowbite-svelte-blocks copied to clipboard

ESLint Error on Testimonials component using Quotes component as value for icon prop

Open jpdom opened this issue 1 year ago • 0 comments

Describe the bug


<Testimonial icon={Quotes}>

(...)

Causes:

ts(2322)
Type 'typeof Quotes' is not assignable to type 'typeof SvelteComponent'.
  Types of construct signatures are incompatible.
    Type 'new (options: ComponentConstructorOptions<{ [x: string]: never; }>) => Quotes' is not assignable to type 'new <Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any>(options: ComponentConstructorOptions<Props>) => SvelteComponent<...>'.
      Types of parameters 'options' and 'options' are incompatible.
        Type 'ComponentConstructorOptions<Props>' is not assignable to type 'ComponentConstructorOptions<{ [x: string]: never; }>'.
          Type 'Props' is not assignable to type '{ [x: string]: never; }'.
            Type 'Record<string, any>' is not assignable to type '{ [x: string]: never; }'.
              'string' index signatures are incompatible.
                Type 'any' is not assignable to type 'never'.

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-k7nbpv?file=src%2Froutes%2F%2Bpage.svelte&view=editor

In VSCode, ESLint shows the error I described.

image

Flowbite version and System Info

System:
    OS: Windows 11 10.0.22621
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-1280P
    Memory: 9.57 GB / 31.71 GB
  Binaries:
    Node: 18.19.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.2.3 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (120.0.2210.144)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    @sveltejs/kit: ^1.30.3 => 1.30.3
    flowbite-svelte: ^0.44.22 => 0.44.22
    svelte: ^4.2.9 => 4.2.9
    vite: ^4.5.2 => 4.5.2

jpdom avatar Jan 21 '24 21:01 jpdom