JSDuck supports the concept of documenting class members not explicitly declared in code. Typically this is used for creating basic entities for upstream libraries.
In general however it uses the rule that a documentation block and code are only associated when directly connected. If there is an empty line between, then it is no longer associated.
So e.g.
/**
* Descriptive description of Foo.
*
* @class Foo
*/
/**
* Descriptive description of bar.
*
* @method bar
* @param x
*/
( function ( $ ) {
..
}( jQuery ) );
Would not associate method bar with the closure. And it would not throw a warning about parameter x not matching $, for two reasons:
There is a new line in between.
It is not a plain function declaration or expression assigned to a property in an object literal, or variable assignment. As such, the function seen there is irrelevant.
The same is like this:
/**
* @param x
*/
var foo = ( function ( y, z ) {
..
return function ( x ) { .. };
}( 1, 2 ) );
I'm not sure whether this error is a regression, or that it is part of a new rule. But for Wikimedia, jquery.suggestions.js (source code) is causing the following warning:
27 | * @param {Object} options
13:54:14 Expected $ but got options at ./resources/src/jquery/jquery.suggestions.js :
Because it is wrongly associating the block with the closure.
JSDuck supports the concept of documenting class members not explicitly declared in code. Typically this is used for creating basic entities for upstream libraries.
Examples:
In general however it uses the rule that a documentation block and code are only associated when directly connected. If there is an empty line between, then it is no longer associated.
So e.g.
Would not associate method bar with the closure. And it would not throw a warning about parameter
x
not matching$
, for two reasons:The same is like this:
I'm not sure whether this error is a regression, or that it is part of a new rule. But for Wikimedia, jquery.suggestions.js (source code) is causing the following warning:
Because it is wrongly associating the block with the closure.