yuanchuan / sveltekit-autoimport

Automatically detect and import components/modules for SvelteKit projects
https://npm.im/sveltekit-autoimport
MIT License
231 stars 10 forks source link

TS let statement breaking import #19

Closed stolinski closed 2 years ago

stolinski commented 2 years ago

Interesting one here.

Works

<script lang="ts">
    import { fly } from 'svelte/transition'
</script>

Doesn't Work

<script lang="ts">
    import { fly } from 'svelte/transition'

    let y: number
</script>

Something about this let y: number is breaking the import in this file. I don't have a reproduction yet, but I can make one.

yuanchuan commented 2 years ago

Somehow the svelte.preprocess() doesn't have any effect

https://github.com/yuanchuan/sveltekit-autoimport/blob/main/src/index.js#L110

yuanchuan commented 2 years ago

Please try 1.6.7. I've tested locally and it works now.

stolinski commented 2 years ago

Works perfectly. Thank you.