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

Refactor to reduce code duplication and refine types #116

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Dschungelabenteuer
Copy link
Member

What Changed

  • chore: fix ESLint and TypeScript issues #113 mentions some issues that were not addressed, especially these todo notes. I've made changes so that it actually follows @typescript-eslint/parser's output AST. All literals are gathered in a Literal union type, which requires some type narrowing. According to docs and @storybook/csf types, descriptors should only support arrays of strings and single regexes, I've updated code accordingly.
  • While browsing the code, I've came across some code duplication, and some code that could benefit from further splitting (to make tests easier, and maybe improve readability (not that much confident about that huh). I took the liberty of refactoring a bit what appeared relevant (at least to me). Please let me know if you think I got carried away 😅

Checklist

Check the ones applicable to your change:

  • Ran yarn update-all
  • Tests are updated <- Didn't need to, but ran them to make sure everything's still okay!
  • Documentation is updated

Change Type

Indicate the type of change your pull request is:

  • maintenance
  • documentation
  • patch
  • minor
  • major

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.

1 participant