Svelte/5/Svelte Element Expression

/icons/calendar.svg

Last update

Sep 9, 2024

This codemod updates Svelte component definitions by transforming the this attribute in <svelte:element> tags:

  • Converts this="..." syntax to this={...} format.
  • Ensures proper JSX-like syntax within Svelte components for consistency with Svelte's latest standards.

Before

<svelte:element this="div">

After

<svelte:element this={"div"}>

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now