Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Svelte props declaration conversion 4 to 5New to Visual Studio Code? Get it now.
Svelte props declaration conversion 4 to 5

Svelte props declaration conversion 4 to 5

Sebastian Wiberg

|
27 installs
| (0) | Free
Convert Svelte 4 to 5 props (export let -> let { .. } = $props()
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

svelte-props-4-to-5 README

Converts props declaration that uses Svelte 4 syntax into Svelte 5 syntax. NOTE! Does not properly format the code - use prettier/linter to auto format instead.

Example:

export let a: number = 1; export let b: string = "hello"; export let c: boolean = true;

converts into:

let { a = 1, b = "hello", c = true }: { a: number, b: string, c: boolean } = $props();

(except the formatting will be broken until auto-formatted by prettier)

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft