Skip to content

Svelte 5: Parsing Error with Snippets #686

Closed
@abdel-17

Description

@abdel-17

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?

8.56.0

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

2.63.0-next.5

What did you do?

ESlint fails to parse snippets whose arguments are function calls.

<script lang="ts">
	import type { Snippet } from "svelte";

	let { foo } = $props<{ foo: Snippet<[string]> }>();

	function bar() {
		return "baz";
	}
</script>

{@render foo(bar())}

What did you expect to happen?

Parsing should not fail.

Screen.Recording.2024-02-21.at.12.54.57.PM.mov

What actually happened?

  13:11  error  Parsing error: ')' expected

✖ 1 problem (1 error, 0 warnings)

Link to GitHub Repo with Minimal Reproducible Example

https://github.com/abdel-17/svelte-eslint-bug-reproduction

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