fix: Fix react-docgen complaining about missing filename config #24
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.
When I updated
react-docgen
in another PR, I first added a check to only use thefilename
option for TS files. But that broke my (and possibly others) project build complaining that thefilename
option is required for those files. This is the error I was getting:The file producing this error was a
.js
file with pretty simple JSX syntax into it.I started looking into this, and noticed that adding the
filename
option for all files when calling thereact-docgen
lib fixed the issue. In my other PR the tests were breaking for react and flow with thatfilename
option because I had to install a babel presets for those (since I updated babel, I didn't really add these presets).So this PR adds the presets for react and flow + no longer checks if the file extension is
ts
in order to use thefilename
option. That'll now be provided for every file that's used.btw, no idea why the package.lock file had such a big difference from old to new file on this PR, must be related to a different node version we're using... 🙈