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

The TsConfig option vueCompilerOptions.checkUnknownComponents doesn't works standalone #5218

Open
LouisMazel opened this issue Feb 27, 2025 · 3 comments

Comments

@LouisMazel
Copy link

LouisMazel commented Feb 27, 2025

Vue - Official extension or vue-tsc version

2.2.4

VSCode version

1.96.2

Vue version

3.5.13

TypeScript version

5.7.3

System Info

System:
    OS: macOS 15.2
    CPU: (10) arm64 Apple M1 Pro
    Memory: 283.55 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.2.0 - ~/.nvm/versions/node/v21.2.0/bin/node
    Yarn: 1.22.19 - ~/.yarn/bin/yarn
    npm: 10.2.3 - ~/.nvm/versions/node/v21.2.0/bin/npm
    pnpm: 9.10.0 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 133.0.6943.127
    Safari: 18.2

package.json dependencies

Too many

But I'm using unplugin-vue-components to auto import components, that's why I want check if components existing

Steps to reproduce

  1. Enable the option in your tsconfig :
{
 ...
  "vueCompilerOptions": {
    "checkUnknownComponents": true,
  },
}
  1. Add a wrong component in a template :

<UnknownComponent />

  1. Exec type checking

--> No error

What is expected?

Typescript should throw an error: Property 'UnknownComponent' does not exist on type '{}'.

What is actually happening?

No typescript errors while checking

But when I use the option : vueCompilerOptions.strictTemplates
It's works but I don't want enable all others options about Props, Directives and Events

Link to minimal reproduction

No response

Any additional comments?

No response

@KazariEX
Copy link
Member

I cannot reproduce it. Could you please provide a minimal reproduction?

Image

@LouisMazel
Copy link
Author

Yes, no problem in VsCode, but the bug occurs when doing type checking with vue-tsc

pnpx vue-tsc --noEmit 

If it's not reproducible for you, I will make a reproduction link.

@KazariEX
Copy link
Member

Does a --declaration work for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants