Open long2ice opened 1 year ago
The same problem
I also face the same lint problem in WebStorm editor
+1, same issue with JetBrains products.
Wonder if its something that can/should be improved by refined typing or it must be fixed on the IDE side.
same here (PHPStorm)
Same problem with WebStorm
Can add below before the first $t
type definition in vue-i18n.d.ts
.
$t<
Key extends string,
DefinedLocaleMessage extends RemovedIndexResources<DefineLocaleMessage> = RemovedIndexResources<DefineLocaleMessage>,
Keys = IsEmptyObject<DefinedLocaleMessage> extends false
? PickupPaths<{
[K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K]
}>
: never,
ResourceKeys extends Keys = IsNever<Keys> extends false ? Keys : never
>(
key: Key | ResourceKeys | Path,
named?: Record<string, unknown>
): TranslateResult
Thank you for your reporting! Sorry for my late reply. š Unfortunately, I could not reproduce this issue. We need minimal reproduction, so Could you give us your it please?
Thank you for your reporting! Sorry for my late reply. š Unfortunately, I could not reproduce this issue. We need minimal reproduction, so Could you give us your it please?
In which editor? We have the problem in phpstorm or webstorm with the latest stable version.
I use always vscode (sometime vim). I would like to check other editors if I could, but unfortunately I don't have time to check all editors. wish there was something like stackbliz that we could check online...
Same problem in Intelij
Same problem in PHPStorm 2023.1.4 It's annoying that Storm highlights this as a critical error
Same in Webstorm (#WS-232.10227.9, built on November 11, 2023).
Editing the .d.ts, moving the simplest definition of the method $d() below other $d() definitions fix the issue for multiples args but create the same issue for single arg. Same for others methods ($t,...) . My guess is that Webstorm is not checking other definitions for a method, it only takes the first one it found and mark as invalid if the signature does not match.
I only encounter this behaviour with vue-i18n (since many months now), I never got this kind of errors with other libs among many projects.
Reporting a bug?
When I use
$d
and$t
, the ts error occur.Expected behavior
Should no error
Reproduction
Just use it with params
System Info