Skip to content

Snippets that use a () => void type break eslint when using typescript #904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
AlbertMarashi opened this issue Sep 19, 2024 · 2 comments
Closed

Comments

@AlbertMarashi
Copy link

AlbertMarashi commented Sep 19, 2024

Describe the bug

There's a weird eslint bug with parsing snippets that contain () => void, even if it is commented out.

Reproduction

<script lang="ts">

</script>

{#snippet editor_button(foo: {
    // onclick: () => void,
})}

{/snippet}

Parsing error: '}' expected.eslint


<script lang="ts">

</script>

{#snippet editor_button(foo: {
    onclick: () => void,
})}

{/snippet}

Parsing error: '=>' expected.eslint

Logs

No response

System Info

System:
    OS: macOS 14.2
    CPU: (8) arm64 Apple M1 Pro
    Memory: 108.48 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.17.0 - ~/.nvm/versions/node/v20.17.0/bin/node
    npm: 10.8.2 - ~/.nvm/versions/node/v20.17.0/bin/npm
    pnpm: 9.7.0 - ~/Library/pnpm/pnpm
    bun: 1.1.18 - ~/.bun/bin/bun
  Browsers:
    Chrome: 128.0.6613.138
    Safari: 17.2
  npmPackages:
    svelte: 5.0.0-next.244 => 5.0.0-next.244

Severity

blocking upgrade

@paoloricciuti
Copy link
Member

This feels like a https://github.com/sveltejs/eslint-plugin-svelte issue or a https://github.com/sveltejs/svelte-eslint-parser issue considering that svelte parse this correctly (i can't move it there unfortunately)

@Conduitry Conduitry transferred this issue from sveltejs/svelte Nov 3, 2024
@ota-meshi
Copy link
Member

Duplicate of #872
It has already been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants