mirror of https://github.com/sveltejs/svelte
fix: add `lang="ts"` attribute during migration if needed (#14222)
* fix: add `lang="ts"` attribute during migration if needed fixes #14219 * fixpull/14225/head
parent
438de04fb2
commit
31e6bbb646
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: add `lang="ts"` attribute during migration if needed
|
@ -0,0 +1,5 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
use_ts: true
|
||||
});
|
@ -0,0 +1,5 @@
|
||||
<script>
|
||||
// script tag but no lang="ts", because for example only imports present
|
||||
</script>
|
||||
|
||||
<slot />
|
@ -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?.()}
|
@ -0,0 +1,5 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
use_ts: true
|
||||
});
|
@ -0,0 +1,6 @@
|
||||
<script>
|
||||
/** @type {ShouldNotUseTSBecauseImUsingJsDoc} */
|
||||
export let data;
|
||||
</script>
|
||||
|
||||
<slot />
|
@ -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?.()}
|
Loading…
Reference in new issue