Skip to content

Svelte 5 migration script: Props TS interface is reduced to { [key: string]: any } when $$restProps is used #13583

@gwennlbh

Description

@gwennlbh

Describe the bug

A component that uses {...$$restProps} is migrated to svelte 5 with

interface Props { [key: string]: any; }

instead of something like

interface Props {
      prop1: string;
      /** docs for prop2 */
     prop2: number;
     [key: string]: any;
}

This way of defining the interface works really well, see an example is the TS playground

Reproduction

Svelte 5 REPL -- click "MIGRATE" on the Example.svelte component

Logs

No response

System Info

(https://svelte-5-preview.vercel.app)

Severity

blocking an upgrade

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions