-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add
lang="ts"
attribute during migration if needed (#14222)
* fix: add `lang="ts"` attribute during migration if needed fixes #14219 * fix
- Loading branch information
1 parent
438de04
commit 31e6bbb
Showing
9 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'svelte': patch | ||
--- | ||
|
||
fix: add `lang="ts"` attribute during migration if needed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/svelte/tests/migrate/samples/slot-use_ts-2/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { test } from '../../test'; | ||
|
||
export default test({ | ||
use_ts: true | ||
}); |
5 changes: 5 additions & 0 deletions
5
packages/svelte/tests/migrate/samples/slot-use_ts-2/input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script> | ||
// script tag but no lang="ts", because for example only imports present | ||
</script> | ||
|
||
<slot /> |
10 changes: 10 additions & 0 deletions
10
packages/svelte/tests/migrate/samples/slot-use_ts-2/output.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<script lang="ts"> | ||
interface Props { | ||
children?: import('svelte').Snippet; | ||
} | ||
let { children }: Props = $props(); | ||
// script tag but no lang="ts", because for example only imports present | ||
</script> | ||
|
||
{@render children?.()} |
5 changes: 5 additions & 0 deletions
5
packages/svelte/tests/migrate/samples/slot-use_ts-3/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { test } from '../../test'; | ||
|
||
export default test({ | ||
use_ts: true | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/svelte/tests/migrate/samples/slot-use_ts-3/input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<script> | ||
/** @type {ShouldNotUseTSBecauseImUsingJsDoc} */ | ||
export let data; | ||
</script> | ||
|
||
<slot /> |
13 changes: 13 additions & 0 deletions
13
packages/svelte/tests/migrate/samples/slot-use_ts-3/output.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<script> | ||
/** | ||
* @typedef {Object} Props | ||
* @property {ShouldNotUseTSBecauseImUsingJsDoc} data | ||
* @property {import('svelte').Snippet} [children] | ||
*/ | ||
/** @type {Props} */ | ||
let { data, children } = $props(); | ||
</script> | ||
|
||
{@render children?.()} |
2 changes: 1 addition & 1 deletion
2
packages/svelte/tests/migrate/samples/slot-use_ts/output.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<script> | ||
<script lang="ts"> | ||
interface Props { | ||
children?: import('svelte').Snippet; | ||
} | ||
|