TS-friendly, ctrl-click navigable variable references in jsDoc comment blocks

How:

Import whateverVar as a type-only import

Then in your jsDoc comment, you can @link to that variable:

You can then ctrl-click to navigate directly to whateverVar declaration / jsDoc commentary in the code.

(at least in VS code – but I imagine the other modern editors as well).

Why:

This will make orienting to a set of interrelated functions/classes/constants much easier.

For now, likely only to be found on more complex sets of related vars.

See one example in

app/modules/mmrMbr/constituentsModel.ts ---> baseline_fulfillment_quantity

Facilitated by:

TS type-only imports

import type only imports declarations to be used for type annotations and declarations. It always gets fully erased, so there’s no remnant of it at runtime. Similarly, export type only provides an export that can be used for type contexts, and is also erased from TypeScript’s output.

ESLint-plugin-jsdoc

jsDoc linting rules for ESLint

Further notes in spawning PR.