Skip to content

Parsing error '=>' expected when parsing typed snippets #872

Closed
@bradyisom

Description

@bradyisom

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?

9.12.0

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

2.44.1

What did you do?

<script lang="ts">
	function hello() {
		console.log('Hello');
	}
</script>

<h1>Welcome to SvelteKit</h1>
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>

{@render editor_button({ onclick: hello })}

<!-- prettier-ignore -->
{#snippet editor_button(foo: {
    onclick: () => void,
})}
  <button on:click={foo.onclick}>Click me</button>
{/snippet}

What did you expect to happen?

I expect no errors

What actually happened?

Received this error:

  12:15  error  Parsing error: '=>' expected

Link to GitHub Repo with Minimal Reproducible Example

https://github.com/bradyisom/eslint-typed-snippets

Additional comments

To repro with GitHub repo, yarn install and yarn lint

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