A high-performance Vue type checker written in Rust. Drop-in replacement for vue-tsc with significantly faster performance.
npm install -D vue-tsc-rs
pnpm add -D vue-tsc-rs
git clone https://github.com/productdevbook/vue-tsc-rs
cd vue-tsc-rs
cargo install --path crates/vue-tsc-rs
Download from Releases.
# Check current directory
vue-tsc-rs
# Check specific workspace
vue-tsc-rs --workspace ./my-vue-project
# Use specific tsconfig
vue-tsc-rs -p tsconfig.json
# Watch mode
vue-tsc-rs --watch
# JSON output
vue-tsc-rs --output json
# Show timing information
vue-tsc-rs --timings
{
"scripts": {
"typecheck": "vue-tsc-rs",
"typecheck:watch": "vue-tsc-rs --watch"
}
}
| Option | Description |
|---|---|
-w, --workspace <DIR> |
Workspace directory to check |
-p, --project <FILE> |
Path to tsconfig.json |
--watch |
Run in watch mode |
--output <FORMAT> |
Output format: human, human-verbose, json, machine |
--fail-on-warning |
Exit with error on warnings |
--emit-ts |
Emit generated TypeScript files (for debugging) |
--timings |
Show timing information |
--max-errors <N> |
Maximum number of errors to show |
--skip-typecheck |
Skip TypeScript, only run Vue diagnostics |
--ignore <PATTERN> |
Ignore patterns (glob) |
--use-tsgo |
Use tsgo instead of tsc |
-v, --verbose |
Verbose output |
<script setup lang="ts">
import { ref } from 'vue'
const count = ref(0)
</script>
<script setup lang="ts" generic="T extends string">
defineProps<{
items: T[]
selected: T
}>()
</script>
<script setup lang="ts">
const props = defineProps<{
message: string
count?: number
}>()
const emit = defineEmits<{
update: [value: string]
delete: []
}>()
const slots = defineSlots<{
default(props: { item: string }): any
header(): any
}>()
const modelValue = defineModel<string>()
defineExpose({
publicMethod() {}
})
</script>
<template>
<MyComponent :value="typedValue" @update="handleUpdate" />
<div v-for="item in items" :key="item.id">
{{ item.name }}
</div>
<MyComponent>
<template #default="{ item }">
{{ item.name }}
</template>
</MyComponent>
</template>
vue-tsc-rs is built as a Rust workspace with 7 crates:
vue-tsc-rs/
├── crates/
│ ├── source-map/ # Source position tracking
│ ├── vue-parser/ # Vue SFC parser
│ ├── vue-template-compiler/ # Template AST compiler
│ ├── vue-codegen/ # TypeScript code generation
│ ├── vue-diagnostics/ # Vue-specific diagnostics
│ ├── ts-runner/ # TypeScript integration
│ └── vue-tsc-rs/ # CLI application
└── npm/ # npm package
.vue file
↓
[1] Parse SFC (vue-parser)
↓
[2] Vue Diagnostics (vue-diagnostics)
↓
[3] Compile Template (vue-template-compiler)
↓
[4] Generate TypeScript (vue-codegen)
↓
[5] TypeScript Check (ts-runner)
↓
[6] Output (vue-tsc-rs)
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"noEmit": true
},
"include": ["src/**/*.ts", "src/**/*.vue"],
"vueCompilerOptions": {
"target": 3.5,
"strictTemplates": true
}
}
| Option | Type | Description |
|---|---|---|
target |
number | Vue version (3.0, 3.3, 3.5) |
strictTemplates |
boolean | Enable strict template checking |
checkUnknownComponents |
boolean | Warn on unknown components |
checkUnknownDirectives |
boolean | Warn on unknown directives |
| Code | Description |
|---|---|
unknown-component |
Unknown component in template |
unknown-directive |
Unknown directive (v-custom) |
invalid-v-for |
Invalid v-for syntax |
invalid-v-model |
v-model on invalid element |
missing-key |
Missing :key in v-for |
duplicate-macro |
Multiple defineProps/defineEmits |
All standard TypeScript errors are reported with positions mapped back to .vue files.
| Tool | Cold Start | Incremental |
|---|---|---|
| vue-tsc | ~15s | ~5s |
| vue-tsc-rs | ~1.5s | ~0.5s |
Benchmarked on a medium-sized Vue project (100 components)
Performance improvements:
| Platform | Architecture |
|---|---|
| macOS | arm64, x64 |
| Linux | arm64, x64 |
| Windows | arm64, x64 |
cargo build --release
cargo test --workspace
cargo clippy --all-targets -- -D warnings
cargo fmt --check
Contributions are welcome! Please read our contributing guidelines before submitting PRs.
MIT License - see LICENSE for details.
We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.