chore: remove enums from project#266
Merged
markov00 merged 5 commits intoelastic:masterfrom Jul 17, 2019
Merged
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.
|
emmacunningham
approved these changes
Jul 17, 2019
Contributor
emmacunningham
left a comment
There was a problem hiding this comment.
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.
Collaborator
Author
|
🎉 This PR is included in version 8.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR removes all the remaining
enumson the project as babel doesn't supportconst enumdirectly.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
annotationisAnnotationTypeand notlinethat 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.Bottominstead 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../srcexcept 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