3 ms·
Yep! The simplest way to get a typescript setup is via https://github.com/sveltejs/template https://github.com/sveltejs/template. $ npx degit sveltejs/tem
by dgellow 6y ago
Yep!
The simplest way to get a typescript setup is via https://github.com/sveltejs/template https://github.com/sveltejs/template.
$ npx degit sveltejs/template svelte-app
$ cd svelte-app
$ node scripts/setupTypeScript.js
$ npm install
$ npm run dev
Then you're good to go. When you define a <script></script> block in a Svelte file, just be sure to specify the attribute lang="ts". In VSCode with the svelte extension you get intellisense based on types info.
<script lang="ts">
let name: string
</script>
<input bind:value={name} />