Open victorgarciaesgi opened 3 years ago
If you can provide a repro project, we can study it quickly.
@yoyo930021 Will do, definetly think it comes from $emit
events inference from child components after testing some behaviours.
In this file I have this component:
The event in question in SelectContributorItem
:
@yoyo930021 Will do, definetly think it comes from
$emit
events inference from child components after testing some behaviours.In this file I have this component:
The event in question in
SelectContributorItem
:
Follow https://github.com/vuejs/vetur/issues/2343 and https://github.com/vuejs/vetur/issues/2344
So, no solution?
Any workarounds for this issue? It's not just a false-positive error, since the template checker can't find / import the type, in the template the prop shows up as "any" so type checking for that subcomponent is bypassed as well.
A good and simple repro is here: https://github.com/vuejs/vetur/issues/2857#issue-854937961
Edit: FWIW switching to Volar solved this and many other issues for me. Absolutely not a dig for Vetur contributors here, just that Volar saved the day for me!
Same problem here
Wow, Volar did the trick for me too. I tried what @earslap suggested using Volar and it seems to work. I had to disable Vetur>Validation Interpolation as well, but Volar seems to be fulfilling the gap for the time being. I've love to use Vetur Validation Interpolation when this gets resolved.
Still experiencing this issue, though switching to Volar for the time being does seem to solve it.
This happened to me because @Props and @Emit from vue-property-decorator were using typescript types as Objects.
I couldn't fix it for emits, but for props you need to use "import type" instead of "import" on interfaces
It is possible to ask eslint to fix this, using @typescript-eslint/consistent-type-import
with { prefer: 'import-types'}
Vetur: Restart VLS
Info
Problem
In a lot of files I have this error showing when using Typescript interfaces.
I think it's coming from
templateProps
and infered emit events because generaly the type concerned is used in components props or in the typedemit
event usingvue-property-decorator
: