Extend DefineStoreOptionsBase typescript no unused vars #2176
Unanswered
Sporradik
asked this question in
Help and Questions
Replies: 1 comment
-
Unfortunately, in this case, you need to tell eslint to ignore the error |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm trying to implement an optional plugin for a pinia store similar to this suggestion.
I'm unfortunately running into a couple type errors that I'm not sure how to resolve. It seems that when I override
DefineStoreOptonsBase
as per this doc, and then add the 'plugins' property to the definsStore options, I get a "ESLint: 'Store' is defined but never used.(@typescript-eslint/no-unused-vars)" warning because I do not need them. But when I remove<S,Store>
from DefineStoreOptionsBase, I get a different warning stating: "TS2428: All declarations of 'DefineStoreOptionsBase' must have identical type parameters."It states in the documentation that everything should able to be typed safely without disabling any type warnings but I cannot seem to figure out how to deal with this case and I couldn't find promising results while searching for answers. Any suggestions would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions