svelte-eslint-bug Svelte Themes

Svelte Eslint Bug

svelte-eslint-bug

src/routes/+page.svelte contains a each block without an item:

{#each { length: 5}}
    <p>Item</p>
{/each}

This is valid syntax and also a feature explicitly mentioned in the documentation.

However, when running eslint, the following parsing error will be produced:

./svelte-eslint-bug/src/routes/+page.svelte
  0:9  error  Parsing error: null is not an object (evaluating 'node.leadingComments')

āœ– 1 problem (1 error, 0 warnings)

error: "eslint" exited with code 1

Changing the each block to {#each { length: 5} as _} will resolve the problem.

Top categories

Loading Svelte Themes