Closed GnaugGnay closed 2 months ago
Could you provide a minimal reproduction for it?
@KazariEX here is a demo for you
This is a known limitation, we deliberately do not support decorators to avoid overly complex code. However, since I don't know if it can obtain the correct type (or any
) before 2.1, I don't know how to fix it.
@KazariEX I think, you guys should at least provide an option like "suppressTemplateIndexError" for us old-vue-version users. I really appreciate your works on it, but this error lints almost drive me crazy.
How about skipTemplateCodegen
?
@KazariEX Better name than mine!
This is an existing feature, you can configure it in your tsconfig.json
:
"vueCompilerOptions": {
"skipTemplateCodegen": true
}
Could you tell me if using components imported with decorators in template before 2.1 can obtain the correct types?
Could you tell me if using components imported with decorators in template before 2.1 can obtain the correct types?
The answer is No. I thought it's a limitation of vue2 or whatever at the first time and ignore this inconvenience.
As for the "skipTemplateCodegen"
option, I have tried it and turns out it brings more disadvantages.
e.g., I can no longer using cmd + mouseLeft
in template to locate the defination of variables and functions.
The answer is No. I thought it's a limitation of vue2 or whatever at the first time and ignore this inconvenience.
This is what I want to know, If we just infer it as unknown
, fixing it will become easier.
Seems like our opinions finally come up together, hope ur update as soon as posible. I have to use version 2.0.x for a while.
Vue - Official extension or vue-tsc version
Vue - Official extension
VSCode version
1.93.0
Vue version
2(with vue-class-component)
TypeScript version
3.9.10
System Info
package.json dependencies
Steps to reproduce
What is expected?
shows normal with the tag of custom component.
What is actually happening?
shows error with every tag of the custom component.
errors look like: XXX does not exist on type 'Required<{} & __VLS_WithComponent .... ts-plugin(2339).
Link to minimal reproduction
No response
Any additional comments?
it happends when I update the extension to version 2.1.x, and disappears using version 2.0.x.