For this, I declare the property I want to reference as @memberof
its own module (yes, it is in the same module where the @link
tag is).
Then, I just do: {@link module:moduleName.property|textOfTheLink}
Example:
i18n.js module
/**
* @category Lib
* @subcategory i18n
* @module i18n
*/
/**
* Memoized translate method.
*
* @memberof module:i18n <----- THIS
* @type {MemoizedFunction}
* @function translate
* @param {i18n.Scope} scope - The translation scope.
* @param {i18n.TranslateOptions} [options] - Translate options.
* @version 1.0.0
* @since 1.0.0
* @example
* return <Text>{translate("home.title")}</Text>;
*/
export const translate = memoize(
(scope, options = undefined) => i18n.t(scope, options),
(scope, options = undefined) =>
options ? scope + JSON.stringify(options) : scope
);
/**
* Shorthand version of the {@link module:i18n.translate|translate} method. <----- COMBINED WITH THIS :)
*
* @function t
* @example
* const translatedError = t(`errors.codes.${errorCode}`, {
* defaults: [{ message: t("errors.codes.default") }],
* });
*/
export const t = translate;