jsdoc/jsdoc.github.io

Show an optional property in the `property` tag docs

hegemonic opened this issue · 0 comments

As noted in jsdoc/jsdoc#1407, the docs don't currently make it clear that the @property tag can be used to document an optional property, like so:

/**
 * @typedef {Object} Something
 * @property {string} someProperty - required
 * @property {string} [anotherProperty] - optional
 */

We should update the @property docs to show an example of an optional property so that this feature is more discoverable.