blog.chay.dev

@ts-ignore is now supported in Svelte tags!

Before today, if you ever tried to do something like this in Svelte:

<script lang="ts">
  export let items: unknown[];
</script>

<!-- @ts-ignore -->
{#each items as item}
  <p>{item.name}</p>
{/each}

.. the @ts-ignore would be.. well, ignored.

And if you tried searching for a solution, chances are you'd run into this workaround (by cough yours truly).

But hurray, that's no longer relevant, now that https://github.com/sveltejs/language-tools/pull/2950 is merged.