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...
Hi, the ESLint rule
init-declarations
looks for unitialized variable declarations such asThis 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
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...