Skip to content

Commit 1299a0a

Browse files
committed
Merge pull request #64 from zxqfox/hotfix/triple-dots
checkRedundantParams: qualify variable type as optional
2 parents e8e547a + 6901883 commit 1299a0a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

lib/rules/validate-jsdoc/check-redundant-params.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function validateCheckParamNames(node, err) {
2727
}
2828

2929
var param = node.params[i];
30-
var _optional = tag.optional || (tag.type && tag.type.optional);
30+
var _optional = tag.optional || (tag.type && (tag.type.optional || tag.type.variable));
3131

3232
// checking redundant
3333
if (!_optional && !param) {

test/lib/rules/validate-jsdoc/check-redundant-params.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,17 @@ describe('lib/rules/validate-jsdoc/check-redundant-params', function () {
104104
return mystr;
105105
};
106106
}
107+
}, {
108+
it: 'should not report redundant params with variable params',
109+
code: function () {
110+
/**
111+
* Issue #62
112+
* @param {function} callback function to call after the delay
113+
* @param {number} delay delay in ms
114+
* @param {...*} args arbitrary arguments for the callback function
115+
*/
116+
function setTimeout(callback, delay) {}
117+
}
107118
}
108119
/* jshint ignore:end */
109120
]);

0 commit comments

Comments
 (0)