Skip to content

Fix shouldRemoveUndefinedFromOptional in TypeScript strict mode #361

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

Merged

Conversation

shilman
Copy link
Contributor

@shilman shilman commented Jun 2, 2021

Issue: #341

What I did

The shouldRemoveUndefinedFromOptional was broken for TypeScript strict: true mode.

  • Fixed heuristic in the case of strict mode adding an extra undefined to enums/unions
  • Added test cases

Will fix storybookjs/storybook#14523

How to test

See attached unit tests cc @michelengelen

Copy link
Contributor

@michelengelen michelengelen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a ton of cosmetic/syntactic changes in here. Did you run prettier at some point? Or is it your IDEs settings?

Copy link
Contributor

@michelengelen michelengelen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ... @pvasek I would suggest to add prettier and husky in one of the next iterations to prevent these kinds of things.

@pvasek
Copy link
Collaborator

pvasek commented Jun 7, 2021

@michelengelen I am definitely open to anything which can help to avoid this kind of issues.

@pvasek pvasek merged commit 6b58d29 into styleguidist:master Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Controls incorrectly populating an undefined option
3 participants