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

Index value from {#each} seen as missing-declaration #37

Closed
tivac opened this issue Jul 18, 2019 · 3 comments
Closed

Index value from {#each} seen as missing-declaration #37

tivac opened this issue Jul 18, 2019 · 3 comments
Labels
svelte This is a bug or a missing feature in Svelte

Comments

@tivac
Copy link

tivac commented Jul 18, 2019

While I know this keyed {#each} is a little silly-looking, it is exposing what I believe is a bug in the plugin.

{#each things as thing, idx (`thing-${idx}`)}

is giving me this message:

9:63  warning  'idx' is not defined            missing-declaration

using svelte@3.5.3, eslint-plugin-svelte3@2.6.0, and eslint@6.0.1

@Conduitry
Copy link
Member

missing-declaration is a warning from the compiler, so this seems like a bug in Svelte and not in this plugin. If you stick the same code in the REPL you'll see that warning there as well.

Does this code work properly apart from the warning? Does the keyed value actually have access to the index variable, or is there a bigger problem here?

@Conduitry Conduitry added the svelte This is a bug or a missing feature in Svelte label Jul 18, 2019
@tivac
Copy link
Author

tivac commented Jul 18, 2019

Whoops, should've dug into that further. The keying is a little nonsensical (keying by only array index is pointless) but does seem to function fine yes.

@Conduitry
Copy link
Member

Fixed in Svelte v3.6.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
svelte This is a bug or a missing feature in Svelte
Projects
None yet
Development

No branches or pull requests

2 participants