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

Suggestion: Override init-declarations #684

Open
marekdedic opened this issue Feb 14, 2024 · 0 comments
Open

Suggestion: Override init-declarations #684

marekdedic opened this issue Feb 14, 2024 · 0 comments
Labels

Comments

@marekdedic
Copy link
Contributor

Hi,
the ESLint rule init-declarations looks for unitialized variable declarations such as

let myVar;

This is certainly useful (although a matter of opinion, which is why it isn't in the recommended set I believe), but breaks with Svelte, because in Svelte, there are export declarations with special meaning such as

<script>
  export let propWithoutDefault;
</script>

{propWithoutDefault}

The rule triggers for these as well, which is incorrect. I don't know what the correct fix is (I can imagine adding an override rule or fixing it in the parser so that the export declarations are not checked by rules checking for declarations, but that would probably create more issues).

There is also an extended @typescript-eslint/init-declarations rule, which probably further complicates the matter...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants