From bd54aa188df2a721ab7af311dab4e668958f16f5 Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Tue, 16 Apr 2024 22:45:37 +0200 Subject: [PATCH] feat: add self-closing-tags migration (#12128) * feat: add self-closing-tags migration Companion to sveltejs/svelte#11114. This adds an npx svelte-migrate self-closing-tags migration that replaces all the self-closing non-void elements in your .svelte files. * use local Svelte installation --- .changeset/sixty-walls-act.md | 5 + .../default/src/routes/sverdle/+page.svelte | 2 +- .../anchor-afternavigate/+page.svelte | 2 +- .../anchor-onmount/+page.svelte | 2 +- .../data-sveltekit/noscroll/+page.svelte | 2 +- .../noscroll/target/+page.svelte | 2 +- .../routes/iframes/nested/parent/+page.svelte | 2 +- .../src/routes/no-ssr/margin/+page.svelte | 2 +- .../basics/src/routes/routing/+page.svelte | 2 +- .../scroll/cross-document/a/+page.svelte | 2 +- .../migrations/self-closing-tags/index.js | 56 +++++ .../migrations/self-closing-tags/migrate.js | 191 ++++++++++++++++++ .../self-closing-tags/migrate.spec.js | 31 +++ packages/migrate/package.json | 5 +- pnpm-lock.yaml | 13 ++ .../src/routes/home/Video.svelte | 2 +- 16 files changed, 310 insertions(+), 11 deletions(-) create mode 100644 .changeset/sixty-walls-act.md create mode 100644 packages/migrate/migrations/self-closing-tags/index.js create mode 100644 packages/migrate/migrations/self-closing-tags/migrate.js create mode 100644 packages/migrate/migrations/self-closing-tags/migrate.spec.js diff --git a/.changeset/sixty-walls-act.md b/.changeset/sixty-walls-act.md new file mode 100644 index 000000000000..f3271cbfd42b --- /dev/null +++ b/.changeset/sixty-walls-act.md @@ -0,0 +1,5 @@ +--- +"svelte-migrate": minor +--- + +feat: add self-closing-tags migration diff --git a/packages/create-svelte/templates/default/src/routes/sverdle/+page.svelte b/packages/create-svelte/templates/default/src/routes/sverdle/+page.svelte index 68ab6400de82..42d987106d37 100644 --- a/packages/create-svelte/templates/default/src/routes/sverdle/+page.svelte +++ b/packages/create-svelte/templates/default/src/routes/sverdle/+page.svelte @@ -200,7 +200,7 @@ stageHeight: window.innerHeight, colors: ['#ff3e00', '#40b3ff', '#676778'] }} - /> + > {/if}