Skip to content

Each blocks without item produce parsing error #953

@kklemon

Description

@kklemon

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.

What version of ESLint are you using?

v9.16.0

What version of eslint-plugin-svelte are you using?

2.46.1

What did you do?

Attempted to lint a svelte file containing an each block without item.

What did you expect to happen?

ESLint should be capable of parsing and processing a each block without item as it is valid syntax and also a feature explicitly mentioned in the documentation.

What actually happened?

ESLint parsing error:

./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

Link to GitHub Repo with Minimal Reproducible Example

https://github.com/kklemon/svelte-eslint-bug

Additional comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions