Skip to content

Commit 792be3d

Browse files
Christopher HillerAlexej Yaroshevich
authored andcommitted
checkRedundantParams, checkParamNames: add jsdoc check, etc
- fix several exceptions when validating files missing jsdoc tags Closes #37 Closes #38
1 parent f5182b6 commit 792be3d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ module.exports.options = {
1010
* @param {Function} err
1111
*/
1212
function validateCheckParamNames(node, err) {
13+
if (!node.jsdoc) {
14+
return;
15+
}
16+
1317
node.jsdoc.iterateByType(['param', 'arg', 'argument'],
1418
/**
1519
* tag checker

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ module.exports.options = {
1010
* @param {Function} err
1111
*/
1212
function validateCheckParamNames(node, err) {
13+
if (!node.jsdoc) {
14+
return;
15+
}
16+
1317
node.jsdoc.iterateByType(['param', 'arg', 'argument'],
1418
/**
1519
* tag checker
@@ -18,7 +22,7 @@ function validateCheckParamNames(node, err) {
1822
*/
1923
function(tag, i) {
2024
// skip if there is dot in param name (object's inner param)
21-
if (tag.name.value.indexOf('.') !== -1) {
25+
if (tag.name && tag.name.value.indexOf('.') !== -1) {
2226
return;
2327
}
2428

0 commit comments

Comments
 (0)