fix(citycorners): move @const outside HTML element to satisfy Svelte 5 rules

{@const} must be immediate child of {#each}/{#if}/etc, not nested
inside HTML elements.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-03-30 19:35:33 +02:00
parent 961cdfbcd2
commit 79c6ab10ea

View file

@ -101,6 +101,8 @@
{:else}
<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
{#each filtered as city}
{@const count = locationCounts.get(city.id) || 0}
{@const cityStats = getCityStats(filterByCity(allLocations.value, city.id))}
<a
href="/cities/{city.slug}"
class="group relative overflow-hidden rounded-xl border border-border bg-background-card transition-shadow hover:shadow-lg"
@ -136,8 +138,6 @@
{city.description}
</p>
{/if}
{@const count = locationCounts.get(city.id) || 0}
{@const cityStats = getCityStats(filterByCity(allLocations.value, city.id))}
<div class="mt-2 flex flex-wrap items-center gap-2">
<span
class="inline-flex items-center gap-1 rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary"