Vue - Official extension or vue-tsc version
vue-tsc 3.2.7
VSCode version
N/A. Reproduced with vue-tsc CLI.
Vue version
3.5.32
TypeScript version
6.0.3
System Info
System:
OS: Windows 11 10.0.26200
CPU: (24) x64 AMD Ryzen AI 9 HX 370 w/ Radeon 890M
Memory: 12.04 GB / 31.12 GB
Binaries:
Node: 25.9.0
npm: 11.12.1
pnpm: 10.33.0
Browsers:
Edge: Chromium (140.0.3485.54)
package.json dependencies
{
"dependencies": {
"vue": "^3.5.32"
},
"devDependencies": {
"vitepress": "2.0.0-alpha.17",
"vue-tsc": "^3.2.7"
}
}
Steps to reproduce
- Open this reproduction project.
- Run
pnpm install --ignore-workspace.
- Run
pnpm run typecheck.
- Inspect
docs/index.md.
What is expected?
vue-tsc should understand that hourValue, start, and end are used inside the returned template string of formatHourLabel(), and that formatHourLabel() is used by the Markdown template.
<script setup lang="ts">
function formatHourLabel(hourValue: number) {
const start = `${String(hourValue).padStart(2, "0")}:00`;
const end = `${String(hourValue).padStart(2, "0")}:59`;
return `${start}-${end}`;
}
</script>
<div>{{ formatHourLabel(1) }}</div>
What is actually happening?
vue-tsc reports TS6133 for the helper parameter and both local variables even though the helper result is rendered by the Markdown template.
docs/.vitepress/config.ts(1,30): error TS2307: Cannot find module 'vitepress' or its corresponding type declarations.
docs/index.md(2,26): error TS6133: 'hourValue' is declared but its value is never read.
docs/index.md(3,9): error TS6133: 'start' is declared but its value is never read.
docs/index.md(4,9): error TS6133: 'end' is declared but its value is never read.
Link to minimal reproduction
https://github.com/HowieHz/vue-tsc-error/tree/main/vitepress-vue-tsc-template-string-locals
Any additional comments?
No response
Vue - Official extension or vue-tsc version
vue-tsc 3.2.7
VSCode version
N/A. Reproduced with vue-tsc CLI.
Vue version
3.5.32
TypeScript version
6.0.3
System Info
package.json dependencies
{ "dependencies": { "vue": "^3.5.32" }, "devDependencies": { "vitepress": "2.0.0-alpha.17", "vue-tsc": "^3.2.7" } }Steps to reproduce
pnpm install --ignore-workspace.pnpm run typecheck.docs/index.md.What is expected?
vue-tscshould understand thathourValue,start, andendare used inside the returned template string offormatHourLabel(), and thatformatHourLabel()is used by the Markdown template.What is actually happening?
vue-tscreportsTS6133for the helper parameter and both local variables even though the helper result is rendered by the Markdown template.Link to minimal reproduction
https://github.com/HowieHz/vue-tsc-error/tree/main/vitepress-vue-tsc-template-string-locals
Any additional comments?
No response