Skip to content

Conflict with lib.dom.d.ts when using runes #557

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
4 tasks done
AlbertMarashi opened this issue Aug 12, 2024 · 1 comment · Fixed by #604
Closed
4 tasks done

Conflict with lib.dom.d.ts when using runes #557

AlbertMarashi opened this issue Aug 12, 2024 · 1 comment · Fixed by #604

Comments

@AlbertMarashi
Copy link

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?

  • 9.9.0

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

  • svelte-eslint-parser@0.41.0

What did you do?

https://sveltejs.github.io/svelte-eslint-parser/virtual-script-code/#eJyrVkrOT0lVslKyKU4uyiwoUchJzEu3jVEqKY5RsovJy0ktUahWyEvMTVWotYKyrBSKS4oy89IVahVsFVQKivILijU0Y/Ji8mz0IWYA9cH0KNUCAEUdIQ4=

<script lang="ts">
let { name }: { name: string } = $props()

</script>
{ name }

What did you expect to happen?

Name should be able to be defined and not conflict with globals

What actually happened?

It conflicts with the DOM lib globals

Link to GitHub Repo with Minimal Reproducible Example

https://sveltejs.github.io/svelte-eslint-parser/virtual-script-code/#eJyrVkrOT0lVslKyKU4uyiwoUchJzEu3jVEqKY5RsovJy0ktUahWyEvMTVWotYKyrBSKS4oy89IVahVsFVQKivILijU0Y/Ji8mz0IWYA9cH0KNUCAEUdIQ4=

Additional comments

No response

@AlbertMarashi
Copy link
Author

Adding an export {} to the end of the virtual script code resolves this issue, as it forces typescript to treat the module as an actual module

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

Successfully merging a pull request may close this issue.

1 participant