language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

Options api type issue

Open zam157 opened this issue 2 years ago • 7 comments

Vue Playground

If i set some props to App.vue, the type of Comp.vue in App.vue's template is any, comment out the prop related code the type of the Comp.vue is fine

Not sure if this is related to vue core type

image

image

zam157 avatar Oct 26 '23 06:10 zam157

Indeed this is a vue core type issue

so1ve avatar Oct 26 '23 13:10 so1ve

Indeed this is a vue core type issue

I'll make a copy issue there later

zam157 avatar Oct 27 '23 01:10 zam157

https://github.com/vuejs/core/issues/9296

so1ve avatar Oct 27 '23 01:10 so1ve

Oh sorry I didn't find out that you have already created that issue

zam157 avatar Oct 27 '23 02:10 zam157

TS Language Server behaves differently in js and ts:

image

image

In .js files, it seens like unknown or void will be automatically converted to any, and it dosen't match the function overloading type of defineComponent

workaround: pnpm patch "@vue/runtime-core" then add some new function overloading types for defineComponent to handle this situation

Vue Playground

image

image

zam157 avatar Nov 18 '23 15:11 zam157

TS Language Server performs not the same between .ts and .js files:

yeah, as @so1ve mentioned in https://github.com/vuejs/language-tools/issues/3690#issuecomment-1782170958

rchl avatar Nov 18 '23 15:11 rchl

TS Language Server performs not the same between .ts and .js files:

yeah, as @so1ve mentioned in #3690 (comment)

I know, just add some detail and workaround for this issue

zam157 avatar Nov 18 '23 16:11 zam157