-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
TypeScript errors with vue-tsc --noEmit
#763
Comments
Duplicate of #758 |
Much more type-safe solution for me is using diff --git a/dist/pinia.d.ts b/dist/pinia.d.ts
index 947b13cfe11c851358d9ef3cc8b97100f3db31b6..88fabc1da4a9c6ef9f8007836941448b253d4df7 100644
--- a/dist/pinia.d.ts
+++ b/dist/pinia.d.ts
@@ -1,7 +1,9 @@
import { App } from 'vue-demi';
import { ComputedRef } from 'vue-demi';
+// @ts-ignore
import { DebuggerEvent } from 'vue-demi';
import { EffectScope } from 'vue-demi';
+// @ts-ignore
import { Plugin as Plugin_2 } from 'vue-demi';
import { Ref } from 'vue-demi';
import { ToRefs } from 'vue-demi';
@@ -513,7 +515,9 @@ export declare interface PiniaCustomStateProperties<S extends StateTree = StateT
/**
* @deprecated use `PiniaVuePlugin` instead.
*/
+// @ts-ignore
export declare const PiniaPlugin: ((app: App<any>, ...options: any[]) => any) & {
+ // @ts-ignore
install?: ((app: App<any>, ...options: any[]) => any) | undefined;
}; |
Adapting this requires a few changes: |
Patch for diff --git a/dist/pinia.d.ts b/dist/pinia.d.ts
index e0b5f993dc45072df1d0a8ad110d22785d8d663d..6f8ca69c1221566998f4d5040bf53a08d0432355 100644
--- a/dist/pinia.d.ts
+++ b/dist/pinia.d.ts
@@ -1,7 +1,9 @@
import { App } from 'vue-demi';
import { ComputedRef } from 'vue-demi';
+// @ts-ignore
import { DebuggerEvent } from 'vue-demi';
import { EffectScope } from 'vue-demi';
+// @ts-ignore
import { Plugin as Plugin_2 } from 'vue-demi';
import { Ref } from 'vue-demi';
import { ToRefs } from 'vue-demi'; Maybe I could look into that later if I have some time, but not sure. |
Updated to 2.0.2 and everything is working now without patch |
Nice! 💪 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reproduction
On demand
Steps to reproduce the behavior
pinia
yarn vue-tsc --noEmit
Expected behavior
No compile time TS errors
Actual behavior
The text was updated successfully, but these errors were encountered: