Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emitting declarations for a single file adds global declarations which have ts errors #5243

Open
brc-dd opened this issue Mar 3, 2025 · 0 comments · May be fixed by #5245
Open

emitting declarations for a single file adds global declarations which have ts errors #5243

brc-dd opened this issue Mar 3, 2025 · 0 comments · May be fixed by #5245
Labels
good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first 🔨 p3-minor-bug

Comments

@brc-dd
Copy link
Member

brc-dd commented Mar 3, 2025

Vue - Official extension or vue-tsc version

2.2.8

VSCode version

1.97.2

Vue version

3.5.13

TypeScript version

5.7.3

System Info

System:
    OS: macOS 15.3.1
    CPU: (10) arm64 Apple M2 Pro
    Memory: 107.77 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 23.7.0 - ~/.local/state/fnm_multishells/42863_1740988676037/bin/node
    Yarn: 1.22.22 - ~/.local/state/fnm_multishells/42863_1740988676037/bin/yarn
    npm: 10.9.2 - ~/.local/state/fnm_multishells/42863_1740988676037/bin/npm
    pnpm: 9.15.4 - ~/.local/state/fnm_multishells/42863_1740988676037/bin/pnpm
    bun: 1.2.0 - /opt/homebrew/bin/bun
  Browsers:
    Safari: 18.3

package.json dependencies

{
  "private": true,
  "type": "module",
  "scripts": {
    "check": "rimraf dist && vue-tsc --declaration --emitDeclarationOnly src/App.vue --outFile dist/App.vue.d.ts"
  },
  "dependencies": {
    "vue": "^3.5.13"
  },
  "devDependencies": {
    "@tsconfig/node22": "^22.0.0",
    "@types/node": "^22.13.4",
    "@vitejs/plugin-vue": "^5.2.1",
    "@vue/tsconfig": "^0.7.0",
    "npm-run-all2": "^7.0.2",
    "rimraf": "^6.0.1",
    "typescript": "~5.7.3",
    "vite": "^6.1.0",
    "vite-plugin-vue-devtools": "^7.7.2",
    "vue-tsc": "^2.2.8"
  }
}

Steps to reproduce

  1. clone https://github.com/brc-dd/vue-tsc-ts-ignore-strip
  2. run pnpm i; pnpm check
  3. open dist/App.vue.d.ts to see errors

What is expected?

The source has // @ts-ignore in these parts:

// @ts-ignore
function __VLS_getSlotParams<T>(slot: T): Parameters<__VLS_PickNotAny<NonNullable<T>, (...args: any[]) => any>>;
// @ts-ignore
function __VLS_getSlotParam<T>(slot: T): Parameters<__VLS_PickNotAny<NonNullable<T>, (...args: any[]) => any>>[0];

These should be present in the output dist too. Or better fix those types if possible 👀 Or maybe not emit global types like when whole project is compiled.

What is actually happening?

Those comments are getting stripped somewhere.

Link to minimal reproduction

https://github.com/brc-dd/vue-tsc-ts-ignore-strip

Any additional comments?

x-ref: #5232 (comment)

@KazariEX KazariEX added good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first 🔨 p3-minor-bug and removed pending triage labels Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first 🔨 p3-minor-bug
Projects
None yet
2 participants