Skip to content
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

svelte2tsx outputs wrong invalid TSX (return value -> events) #886

Closed
hgiesel opened this issue Mar 18, 2021 · 2 comments · Fixed by #887
Closed

svelte2tsx outputs wrong invalid TSX (return value -> events) #886

hgiesel opened this issue Mar 18, 2021 · 2 comments · Fixed by #887
Labels
bug Something isn't working Fixed Fixed in master branch. Pending production release.

Comments

@hgiesel
Copy link
Contributor

hgiesel commented Mar 18, 2021

Describe the bug
svelte2tsx outputs invalid tsx given the example.

To Reproduce
Parse the following code with svelte2tsx:

<script>
    import { createEventDispatcher } from "svelte";

    const dispatch = createEventDispatcher();
    dispatch("mount", { input });
</script>

<input on:focus />

It also works, if you do it in the Svelte2tsx REPL. There is a comma missing in the return value, in the events property.

Expected behavior
Output valid tsx.

System (please complete the following information):

  • OS: macOS, Browser
  • Plugin/Package: svelte2tsx, I use the npm package directly
@dummdidumm
Copy link
Member

Thanks for the report! Off topic question: What's your use case for using svelte2tsx directly?

@dummdidumm dummdidumm added the Fixed Fixed in master branch. Pending production release. label Mar 19, 2021
dummdidumm pushed a commit to dummdidumm/language-tools that referenced this issue Mar 19, 2021
dummdidumm added a commit that referenced this issue Mar 19, 2021
@hgiesel
Copy link
Contributor Author

hgiesel commented Mar 19, 2021

The Ankitects team uses it for using Svelte + TypeScript with Bazel, usage here.

hgiesel added a commit to hgiesel/rules_svelte that referenced this issue Mar 19, 2021
- Fixes an issue I had while working custom elements and built-in elements (sveltejs/language-tools#886)
hgiesel added a commit to hgiesel/rules_svelte that referenced this issue Mar 19, 2021
- Fixes an issue I had while working custom events and built-in events (sveltejs/language-tools#886)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Fixed Fixed in master branch. Pending production release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants