Skip to content

Commit cb5c2a5

Browse files
committed
Merge pull request #66 from zxqfox/hotfix/skip-dotted-params
checkParamNames: skip dotted params (as it was initially)
2 parents 5d24286 + b311704 commit cb5c2a5

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ function validateCheckParamNames(node, err) {
2626
}
2727
});
2828
var outOfOrder = {};
29+
var skipped = 0;
2930

3031
node.jsdoc.iterateByType(['param', 'arg', 'argument'],
3132
/**
@@ -39,12 +40,17 @@ function validateCheckParamNames(node, err) {
3940
return err('missing param name', tag.loc);
4041
}
4142

42-
var param = node.params[i];
43+
var param = node.params[i - skipped];
4344
if (!param) {
4445
// skip if no param
4546
return;
4647
}
4748

49+
if (tag.value.indexOf('.') !== -1) {
50+
skipped++;
51+
return;
52+
}
53+
4854
// checking name
4955
var msg;
5056
if (tag.name.value !== param.name && !outOfOrder[tag.name.value]) {

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,20 @@ describe('lib/rules/validate-jsdoc/check-param-names', function() {
256256
*/
257257
function methodThree(required, optional) {}
258258
}
259+
}, {
260+
it: 'should not report dotted param names',
261+
code: function() {
262+
/**
263+
* Declares modifier
264+
* @param {Object} mod
265+
* @param {String} mod.modName
266+
* @param {String|Boolean|Array} [mod.modVal]
267+
* @param {Object} props
268+
* @param {Object} [staticProps]
269+
* @returns {Function}
270+
*/
271+
function yeah(mod, props, staticProps) {}
272+
}
259273
}
260274
/* jscs: enable */
261275
/* jshint ignore:end */

0 commit comments

Comments
 (0)