Skip to content

Parsing error: ',' expected #213

@bartektelec

Description

@bartektelec

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

  • I'm using eslint-plugin-svelte. (*.svelte file linting does not work with the parser alone. You should also use eslint-plugin-svelte with it.)
  • I'm sure the problem is a parser problem. (If you are not sure, search for the issue in eslint-plugin-svelte repo and open the issue in eslint-plugin-svelte repo if there is no solution.
  • 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?

8.23.0

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

  • svelte-eslint-parser@0.18.1
  • eslint-plugin-svelte@2.7.0

What did you do?

Updated from svelte-eslint-parser@0.18.0 to svelte-eslint-parser@0.18.1

What did you expect to happen?

I expected eslint to lint my code like before

What actually happened?

Eslint threw an error in one of components pointing to 614:1044 (component doesn't have that many lines), saying error: Parsing error: ',' expected

Link to Minimal Reproducible Example

Repro link
It must've been some change in 0.18.0 -> 0.18.1, because downgrading to 0.18.0 works just fine

Additional comments

It looks like it happens when a reactive assignment is bound to a property of an object.
Like:

$: object.key = doSomething();

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs reproNeed a repository that can reproduce the problem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions