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

svelte/require-each-key should not apply when the array is readonly #555

Open
2 tasks done
DetachHead opened this issue Aug 3, 2023 · 0 comments
Open
2 tasks done
Labels
enhancement New feature or request feat: typescript

Comments

@DetachHead
Copy link
Contributor

DetachHead commented Aug 3, 2023

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?

8.33.0

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

2.32.4

What did you do?

<script lang='ts'>
  const foo = [1,2,3] as const
</script>

{#each foo as value}
{/each}

What did you expect to happen?

no error, because the array cannot be changed so it's safe to iterate over it without a key

What actually happened?

[6:1]: Each block should have a key (svelte/require-each-key)

Link to GitHub Repo with Minimal Reproducible Example

https://sveltejs.github.io/eslint-plugin-svelte/playground/#eJwly0EOwiAQheGrTMZFNzTEuiOtFxEXhI7aSEAZaGIId5e22+/9r6ANM6HCkW1cPgmc8c+pS9xdtQewwXOCRwgwwe0sBnG5g+GDtR/lcWqp9uVExr72thWrcZlqU7lpRYExO2JUBXkll0hG+uYlUr/t/Zt+qIZa/4f9MVs=

@ota-meshi ota-meshi added enhancement New feature or request feat: typescript labels Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feat: typescript
Projects
None yet
Development

No branches or pull requests

2 participants