Skip to content

Commit

Permalink
checkReturnTypes: add 'class' as valid custom object
Browse files Browse the repository at this point in the history
Fixes #32
  • Loading branch information
Alexej Yaroshevich committed Nov 9, 2014
1 parent db9c731 commit e794e86
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/jsdoc.js
Expand Up @@ -255,7 +255,7 @@ function jsDocMatchType (variants, argument) {
}

} else if (argument.type === 'ObjectExpression') {
result = result || (type === 'object');
result = result || (type === 'object' || type === 'class');

} else if (argument.type === 'ArrayExpression') {
result = result || (type === 'array');
Expand Down
11 changes: 11 additions & 0 deletions test/lib/rules/validate-jsdoc/check-return-types.js
Expand Up @@ -245,6 +245,17 @@ describe('rules/validate-jsdoc', function () {
}
};
}
}, {
it: 'should not report on `@returns {Class}` for {}. issue #32',
code: function () {
/**
* @return {Class}
*/
Users.prototype.getState = function()
{
return {};
};
}
}
/* jshint ignore:end */
]);
Expand Down

0 comments on commit e794e86

Please sign in to comment.