Skip to content

re-implement the eslint prefer-const rule #404

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
DetachHead opened this issue Mar 17, 2023 · 1 comment · Fixed by sveltejs/svelte-eslint-parser#299
Closed

re-implement the eslint prefer-const rule #404

DetachHead opened this issue Mar 17, 2023 · 1 comment · Fixed by sveltejs/svelte-eslint-parser#299
Labels
bug Something isn't working

Comments

@DetachHead
Copy link
Contributor

Description

the prefer-const rule included by default in eslint does not understand reactive statements with curly braces:

<script lang="ts">
    let foo: number
    $: {
        foo = 1 // 'foo' is never reassigned. Use 'const' instead. (prefer-const)
    }
</script>

{foo}
@DetachHead DetachHead added the enhancement New feature or request label Mar 17, 2023
@ota-meshi
Copy link
Member

Thank you for the bug report. I think it's probably a parser bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants