Skip to content

Commit bd54aa1

Browse files
authored
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
1 parent f71f381 commit bd54aa1

File tree

16 files changed

+310
-11
lines changed

16 files changed

+310
-11
lines changed

.changeset/sixty-walls-act.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"svelte-migrate": minor
3+
---
4+
5+
feat: add self-closing-tags migration

packages/create-svelte/templates/default/src/routes/sverdle/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200
stageHeight: window.innerHeight,
201201
colors: ['#ff3e00', '#40b3ff', '#676778']
202202
}}
203-
/>
203+
></div>
204204
{/if}
205205

206206
<style>

packages/kit/test/apps/basics/src/routes/anchor-with-manual-scroll/anchor-afternavigate/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
<p id="go-to-element">The browser scrolls to me</p>
1313
</div>
1414
<p id="abcde" style="height: 180vh; background-color: hotpink;">I take precedence</p>
15-
<div />
15+
<div></div>
1616
1717
<a href="/anchor-with-manual-scroll/anchor-afternavigate?x=y#go-to-element">reload me</a>

packages/kit/test/apps/basics/src/routes/anchor-with-manual-scroll/anchor-onmount/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
<p id="go-to-element">The browser scrolls to me</p>
1414
</div>
1515
<p id="abcde" style="height: 180vh; background-color: hotpink;">I take precedence</p>
16-
<div />
16+
<div></div>

packages/kit/test/apps/basics/src/routes/data-sveltekit/noscroll/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div style="height: 2000px; background: palegoldenrod" />
1+
<div style="height: 2000px; background: palegoldenrod"></div>
22

33
<a id="one" href="/data-sveltekit/noscroll/target" data-sveltekit-noscroll>one</a>
44

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<div style="height: 2000px; background: palegoldenrod" />
1+
<div style="height: 2000px; background: palegoldenrod"></div>
22

33
<h1>target</h1>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<iframe title="Child content" src="./child" />
1+
<iframe title="Child content" src="./child"></iframe>

packages/kit/test/apps/basics/src/routes/no-ssr/margin/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="container">
22
<span> ^this is not the top of the screen</span>
3-
<div class="spacer" />
3+
<div class="spacer"></div>
44
</div>
55

66
<style>

packages/kit/test/apps/basics/src/routes/routing/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212

1313
<a href="/routing/b" data-sveltekit-reload>b</a>
1414

15-
<div class="hydrate-test" />
15+
<div class="hydrate-test"></div>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h1>a</h1>
22

3-
<div style="height: 200vh; background: teal" />
3+
<div style="height: 200vh; background: teal"></div>
44

55
<a data-sveltekit-reload href="/scroll/cross-document/b">b</a>

0 commit comments

Comments
 (0)