-
Notifications
You must be signed in to change notification settings - Fork 122
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
chore: remove enums from project #266
Conversation
Codecov Report
@@ Coverage Diff @@
## master #266 +/- ##
==========================================
- Coverage 98.12% 98.11% -0.01%
==========================================
Files 36 37 +1
Lines 2662 2654 -8
Branches 607 621 +14
==========================================
- Hits 2612 2604 -8
Misses 45 45
Partials 5 5
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.
code lgtm. the approach of explicitly assigning each value to itself and then using typeof
in the union type definition looks good and can be extended for the annotation types.
🎉 This PR is included in version 8.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
This PR removes all the remaining
enums
on the project as babel doesn't supportconst enum
directly.The refactoring doesn't create any breaking change, just a bit more verbose code.
@emmacunningham I've also seen a problem with the
AnnotationType
, not resolved in this PR but I can work on it:in this way, if you specify something like
the type of
annotation
isAnnotationType
and notline
that means that if you want to do typechecking on that variable needs to go in a different way. I've fixed that behaviour specifying the exact type for every object value likeBottom: 'bottom' as 'bottom'
and I've reused thetypeof Position.Bottom
instead of rewriting the string type. Let me know what do you thinkChecklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.src/index.ts
(and stories only import from../src
except for test data & storybook)[ ] This was checked for cross-browser compatibility, including a check against IE11[ ] Proper documentation or storybook story was added for features that require explanation or tutorials