Do you happen to have a sample Quasar 0.16 project with Typescript support working? Lack of out of the box support is killing us right now.
It’s actually pretty straightforward…
- Install packages:
- Use the extendWebpack code I posted above in
tsconfig.jsonin the project root. Here’s a sample that I use, but obviously customize to how you like it.
- Add vue.d.ts in the
srcdirectory so that you can import .vue SFCs
Now you can use
<script lang="ts"> blocks in your .vue SFCs and you can rename your
.js plugins, stores, etc. to
.ts. Further you can tweak your setup as per https://vuejs.org/v2/guide/typescript.html.
- No typings for quasar plugins, components, etc. so I write a lot of
.d.tsdefinitions as I go.
- I use Visual Studio Code with Vetur, but the intellisense is not great in SFCs. Class component annotations (https://github.com/vuejs/vue-class-component) help but are not perfect. Same with vuex, although there are hacks like (https://github.com/istrib/vuex-typescript) that work ok.