-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docgen/stop crashing on missing return types (#37929)
In certain situations if `docgen` finds a JSDoc with a description for the return value of a function but there's no corresponding type listed for the return value it will error out and say it's required. This requirement introduces a mismatch with how many TypeScript functions will be idiomatically _typed_. In this patch we're reporting those missing types as _unknown_ and letting the `docgen` continue. When missing return types of default exports `docgen` would silently crash without an error message because of a bug when trying to find the name of the surrounding function _when generating the error message_. This is fixed by special-casing default exports alongside named exports.
- Loading branch information
Showing
4 changed files
with
95 additions
and
73 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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