Merge branch 'elliott/variadic-snippets' of github.com:sveltejs/svelte into elliott/variadic-snippets

pull/10320/head
S. Elliott Johnson 2 years ago
commit a802c92cb6

@ -2,4 +2,4 @@
'svelte': patch
---
feat: snippets can now take multiple arguments
breaking: snippets can now take multiple arguments, support default parameters. Because of this, the type signature has changed

@ -266,7 +266,7 @@ function open(parser) {
}
if (parser.match('snippet')) {
const snippet_declaraion_end = find_matching_bracket(parser.template, parser.index, '{');
const snippet_declaration_end = find_matching_bracket(parser.template, parser.index, '{');
if (!snippet_declaraion_end) {
error(start, 'TODO', 'Expected a closing curly bracket');

@ -237,6 +237,7 @@ You can import the `Snippet` type from `'svelte'`:
The `Snippet` type is generic. Here's how you'd type various cases:
```ts
// @errors: 2305
import type { Snippet } from 'svelte';
type SnippetWithNoArgs = Snippet;

Loading…
Cancel
Save