3

svelte/5/svelte-element-expression

How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

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

jsx

After

jsx

Ready to contribute?

Build your own codemod and share it with the community.