tomblachut / svelte-intellij

Svelte components in WebStorm and friends
MIT License
482 stars 38 forks source link

Disable inspection "SillyAssignmentJS" when assigning to reactive variable #218

Closed NyxCode closed 3 years ago

NyxCode commented 3 years ago

It's pretty common to assign variables to itself to trigger an update:

users.push(user);
users = users;

This, however, triggers this warning:

Variable is assigned to itself Inspection info: Reports assignments of the form x = x. These are pointless, and usually indicate programmer error.

This inspection should be disabled when the left side of the assignment is directly in a <script> tag (and not e.g a local variable)