zodern / melte

Svelte compiler for Meteor with built in tracker integration and HMR
MIT License
33 stars 14 forks source link

lang="ts" seems to confuse VS code #18

Closed skandragon closed 2 years ago

skandragon commented 2 years ago

When I have a construct like:

and using lang="ts" in a Svelte source file, it seems to say that "counts" is not found.

I can work around this with:

    let counts: SiteStatistic
    $m: counts = SiteStatistics.find().fetch()[0]

However, I'm hoping there is a cleaner way. Any suggestions?

skandragon commented 2 years ago

The TS example in the docs also show this as needed, so while I wish it could be defined in the $m block, I'll close this as I should just read the docs better I suppose. :)