mirror of https://github.com/sveltejs/svelte
Merge 70393e8d0e into b4d1583ae2
commit
d913773c83
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
Improve error message when TypeScript syntax is used in snippet parameters without `lang="ts"`
|
||||
@ -0,0 +1,9 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
error: {
|
||||
code: 'js_parse_error',
|
||||
message: 'Unexpected token (did you forget to add `lang="ts"`?)',
|
||||
position: [18, 18]
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,3 @@
|
||||
{#snippet bar(text: string)}
|
||||
{text}
|
||||
{/snippet}
|
||||
@ -0,0 +1,9 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
error: {
|
||||
code: 'js_parse_error',
|
||||
message: 'Unexpected token (did you forget to add `lang="ts"`?)',
|
||||
position: [3, 3]
|
||||
}
|
||||
});
|
||||
@ -0,0 +1 @@
|
||||
{x as number}
|
||||
@ -0,0 +1,9 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
error: {
|
||||
code: 'js_parse_error',
|
||||
message: 'Unexpected token (did you forget to add `lang="ts"`?)',
|
||||
position: [14, 14]
|
||||
}
|
||||
});
|
||||
@ -0,0 +1 @@
|
||||
<div class={x as Foo} />
|
||||
@ -0,0 +1,9 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
error: {
|
||||
code: 'js_parse_error',
|
||||
message: 'Unexpected token (did you forget to add `lang="ts"`?)',
|
||||
position: [2, 2]
|
||||
}
|
||||
});
|
||||
@ -0,0 +1 @@
|
||||
{x: number}
|
||||
@ -0,0 +1,9 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
error: {
|
||||
code: 'js_parse_error',
|
||||
message: 'Unexpected token (did you forget to add `lang="ts"`?)',
|
||||
position: [2, 2]
|
||||
}
|
||||
});
|
||||
@ -0,0 +1 @@
|
||||
{x!}
|
||||
@ -0,0 +1,9 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
error: {
|
||||
code: 'js_parse_error',
|
||||
message: 'Unexpected token (did you forget to add `lang="ts"`?)',
|
||||
position: [3, 3]
|
||||
}
|
||||
});
|
||||
@ -0,0 +1 @@
|
||||
{x satisfies Foo}
|
||||
Loading…
Reference in new issue