language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

`bind:this={}` instead of `bind:this=""`

Open smithliam opened this issue 3 years ago • 1 comments

Describe the bug

The value of bind:this is always dynamic. So, it's better to get bind:this={} instead of bind:this="". We also have the same problem with other things like on:click={} and etc.

https://user-images.githubusercontent.com/101414008/166140713-13bd716b-ae8a-47c1-87b0-dd759919e126.mp4

Reproduction

Not needed.

Expected behaviour

  • bind:this={} instead of bind:this=""
  • on:click={} instead of on:click=""
  • etc.

System Info

  • Windows v10.0.22000
  • VSCode v1.66.2
  • Svelte for VS Code v105.16.0

Which package is the issue about?

Svelte for VS Code

Additional Information, eg. Screenshots

I couldn't find a similar issue🤷‍♂️.

smithliam avatar May 01 '22 09:05 smithliam

It's technically not a "bug". Because you could also do bind:this="{}". I hesitated to change this as someone might like this style more. Also, it might mess up people's muscle memory. But it's probably better to have it with {}. I think I am leaning toward adding it as an optoin.

jasonlyu123 avatar May 01 '22 09:05 jasonlyu123

I would gladly relearn my current muscle memory which is instantly deleting the quotations 😬

williamviktorsson avatar Oct 02 '22 06:10 williamviktorsson