feat: Update react-docgen to add typescript support #20
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.
Description
This PR updates react-docgen to add typescript support, fixing #18
I made use of the
getFakeFlowutil to also get the fake props for typescript, from my investigation on react-docsgen documentation, it looks like both flow and typescript have a pretty similar object structure, so I renamed this helper to be a bit more generic, and used the same one for ts and flow.I also added tests for typescript, pretty much the same tests we have for flow, we now have for flow, and the snapshot results are exactly the same.
I also updated babel and its dependencies, the only thing I had to keep was
babel-eslintto use as the parser forstandard, I tried to update it to@babel/eslint-parser, but for some reason it was complaining about jsx being used on the components, I tried a bunch of different approaches but none really seemed to fix this issue.I'll add comments to the code on some key areas, to explain the reason why some things were used