Skip to content
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

Improve Args API for non-optional fields for TypeScript users #15763

Closed
donaldpipowitch opened this issue Aug 5, 2021 · 1 comment
Closed

Comments

@donaldpipowitch
Copy link
Contributor

Is your feature request related to a problem? Please describe
I recently used the Args API with non-optional fields and this led to some problems. I'm also not sure if this pattern is supported or not. The full background with code examples can be found here.

image

Describe the solution you'd like

  1. Clarify if non-optional fields in the Args API are allowed or not.
  2. If non-optional fields are allowed the Partial<> on args should IMHO be removed.
  3. If non-optional fields are not allowed such a usage should be forbidden or raise warnings. (Maybe this can be raised on the type level already - basically disallowing fields which don't allow undefined - or one could start creating officially baked Storybook ESLint rules - I don't think they already exist or?)

Describe alternatives you've considered
The solution contains alternatives.

Are you able to assist to bring the feature to reality?
Yes.

Additional context

@shilman
Copy link
Member

shilman commented Aug 5, 2021

closing as duplicate to #13747

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants