7.1 General form
The basic formatting of JSDoc blocks is as seen in this example:
/**
* Multiple lines of JSDoc text are written here,
* wrapped normally.
* @param {number} arg A number to do something to.
*/
function doSomething(arg) { … }
or in this single-line example:
/** @const @private {!Foo} A short bit of JSDoc. */
this.foo_ = foo;
If a single-line comment overflows into multiple lines, it must use themulti-line style with /*
and /
on their own lines.
Many tools extract metadata from JSDoc comments to perform code validation andoptimization. As such, these comments must be well-formed.