vue-tsc (Vue Language Tools)
You can use vue-tsc checker for your Vue 3 project. If you're still using Vue2, choose VLS checker.
Installation
INFO
Since 0.7.0, vue-tsc requires at least >= 2.0.0, with typescript >= 5.0.0. If you can't upgrade to the latest version, please use 0.6.x or below version.
Make sure vue-tsc & typescript are installed as a peer dependency of your Vite project.
bashpnpm add vue-tsc@latest typescript -DAdd
vueTscfield to plugin config.jsexport default { plugins: [checker({ vueTsc: true /** or an object config */ })], }
Configuration
Advanced object configuration table of options.vueTsc
| field | Type | Default value | Description |
|---|---|---|---|
| root | string | Vite config root | Root path to find tsconfig file |
| tsconfigPath | string | "tsconfig.json" | Relative tsconfig path to root |
| buildMode | boolean | false | Add --build to vue-tsc flag, note that noEmit does NOT work if buildMode is true (#36917) |
- (optional for Vue2 project only) The type check is powered by
vue-tscso it supports Vue2. According to the documentation, you need to install@vue/runtime-domfor Vue version <=2.6.14.