Skip to content

Commit 05c17e0

Browse files
committed
checkParamNames: added test for optional params
1 parent b88ad6b commit 05c17e0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/lib/rules/validate-jsdoc/check-param-names.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,21 @@ describe('lib/rules/validate-jsdoc/check-param-names', function() {
340340
module.exports.createMiddleware = function() { /* ... */ };
341341
},
342342
errors: []
343+
}, {
344+
it: 'should not report declared optional params',
345+
code: function() {
346+
/**
347+
* Example function
348+
* @param {Object} options - some options
349+
* @param {number} options.id - some id
350+
* @param {Go} [optional] - optional param
351+
* @param {Go=} optional2 - another optional param
352+
* @param {Array} rest - rest arguments
353+
*/
354+
function hello(options, optional, optional2, rest) {
355+
}
356+
},
357+
errors: []
343358
}
344359
/* jscs: enable */
345360
/* jshint ignore:end */

0 commit comments

Comments
 (0)