Skip to content

jsdoc/no-defaults Correctness ​

What it does ​

This rule reports defaults being used on the relevant portion of @param or @default. It also optionally reports the presence of the square-bracketed optional arguments at all.

Why is this bad? ​

The rule is intended to prevent the indication of defaults on tags where this would be redundant with ES6 default parameters.

Examples ​

Examples of incorrect code for this rule:

javascript
/** @param {number} [foo="7"] */
function quux(foo) {}

Examples of correct code for this rule:

javascript
/** @param {number} foo */
function quux(foo) {}

/** @param foo */
function quux(foo) {}

References ​

Released under the MIT License.