-
Notifications
You must be signed in to change notification settings - Fork 112
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
fix(type-defs): make all options optional #56
Conversation
Codecov Report
@@ Coverage Diff @@
## master #56 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 20 20
Branches 3 3
=========================================
Hits 20 20 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may also use Partial<{}>
@pi0 Thanks for that! Didn't think of it. Do you think it would be better / more consistent with other packages to adjust it? - If so, I will do. The definite pro is that you don't have to think about the question-mark on each property. A con would be the possible introduction of required properties in the future. |
Common convention for nuxt config is:
Advantages:
|
it's nuxtjs convention for ColorModeOptions to hold required properties and the config being a Partial<T> of that
When using the module with a typed
nuxt.config.ts
, TypeScript requires all properties of the options object to be set.They don't have to, because the defaults will be used if they are not set.