From 731b8cf00628dcccc9d68dc9eebb5537e06e8754 Mon Sep 17 00:00:00 2001 From: baseballyama Date: Thu, 23 Nov 2023 18:27:53 +0900 Subject: [PATCH] lint --- documentation/docs/02-template-syntax/04-special-tags.md | 2 +- documentation/docs/05-misc/03-typescript.md | 6 ++++-- packages/svelte/src/compiler/types/template.d.ts | 2 +- .../svelte-5-preview/src/lib/Input/ComponentSelector.svelte | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/documentation/docs/02-template-syntax/04-special-tags.md b/documentation/docs/02-template-syntax/04-special-tags.md index 4145d8d6d6..49162bc355 100644 --- a/documentation/docs/02-template-syntax/04-special-tags.md +++ b/documentation/docs/02-template-syntax/04-special-tags.md @@ -80,7 +80,7 @@ The `{@const ...}` tag defines a local constant. {#each boxes as box} - {@const area = box.width * box.height} + {@const } {box.width} * {box.height} = {area} {/each} ``` diff --git a/documentation/docs/05-misc/03-typescript.md b/documentation/docs/05-misc/03-typescript.md index 3fe3580f7e..f8e20ce99e 100644 --- a/documentation/docs/05-misc/03-typescript.md +++ b/documentation/docs/05-misc/03-typescript.md @@ -177,9 +177,11 @@ You cannot use TypeScript in your template's markup. For example, the following let count = 10; -

Count as string: {count as string}!

+

Count as string: {count as string}!

+ {#if count > 4} - {@const countString: string = count} + {@const } + {countString} {/if} ``` diff --git a/packages/svelte/src/compiler/types/template.d.ts b/packages/svelte/src/compiler/types/template.d.ts index f5e55f4829..621e8092b2 100644 --- a/packages/svelte/src/compiler/types/template.d.ts +++ b/packages/svelte/src/compiler/types/template.d.ts @@ -132,7 +132,7 @@ export interface Comment extends BaseNode { export interface ConstTag extends BaseNode { type: 'ConstTag'; declaration: VariableDeclaration & { - declarations: [VariableDeclarator & { id: Identifier, init: Expression } ] + declarations: [VariableDeclarator & { id: Identifier; init: Expression }]; }; } diff --git a/sites/svelte-5-preview/src/lib/Input/ComponentSelector.svelte b/sites/svelte-5-preview/src/lib/Input/ComponentSelector.svelte index 71cd9241b8..cd6aa661fb 100644 --- a/sites/svelte-5-preview/src/lib/Input/ComponentSelector.svelte +++ b/sites/svelte-5-preview/src/lib/Input/ComponentSelector.svelte @@ -212,7 +212,7 @@
{#each $files as file, index (file.name)} - {@const filename = get_full_filename(file)} + {@const }
{:else if filename === editing_name} - {@const editing_file = $files.find((file) => get_full_filename(file) === editing_name)} + {@const } {#if editing_file}