Skip to content

Commit

Permalink
checkRedundantParams, checkParamNames: add jsdoc check, etc
Browse files Browse the repository at this point in the history
- fix several exceptions when validating files missing jsdoc tags

Closes #37
Closes #38
  • Loading branch information
Christopher Hiller authored and Alexej Yaroshevich committed Nov 10, 2014
1 parent f5182b6 commit 792be3d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/rules/validate-jsdoc/check-param-names.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ module.exports.options = {
* @param {Function} err
*/
function validateCheckParamNames(node, err) {
if (!node.jsdoc) {
return;
}

node.jsdoc.iterateByType(['param', 'arg', 'argument'],
/**
* tag checker
Expand Down
6 changes: 5 additions & 1 deletion lib/rules/validate-jsdoc/check-redundant-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ module.exports.options = {
* @param {Function} err
*/
function validateCheckParamNames(node, err) {
if (!node.jsdoc) {
return;
}

node.jsdoc.iterateByType(['param', 'arg', 'argument'],
/**
* tag checker
Expand All @@ -18,7 +22,7 @@ function validateCheckParamNames(node, err) {
*/
function(tag, i) {
// skip if there is dot in param name (object's inner param)
if (tag.name.value.indexOf('.') !== -1) {
if (tag.name && tag.name.value.indexOf('.') !== -1) {
return;
}

Expand Down

0 comments on commit 792be3d

Please sign in to comment.