falso icon indicating copy to clipboard operation
falso copied to clipboard

JSdoc description of function should include a few examples of result

Open czlowiek488 opened this issue 3 years ago • 1 comments

Description

JSdoc should include result examples for each example. This would make finding correct method easier.

It could be fancy to fill examples automatically on some npm hook. If we agree to solution I may implement it.

Proposed solution

/**
 * Generate a random credit card brand.
 *
 * @category Finance
 *
 * @example
 *
 * randCreditCardBrand()
 * 
 * "Visa"
 * "Visa Electron"
 * "UATP"
 */

image

Alternatives considered

No response

Do you want to create a pull request?

Yes

czlowiek488 avatar May 20 '22 16:05 czlowiek488

You're welcome to submit a PR. You can start with POC that shows one example.

NetanelBasal avatar May 21 '22 19:05 NetanelBasal