Skip to content

Commit e794e86

Browse files
author
Alexej Yaroshevich
committed
checkReturnTypes: add 'class' as valid custom object
Fixes #32
1 parent db9c731 commit e794e86

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

lib/jsdoc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ function jsDocMatchType (variants, argument) {
255255
}
256256

257257
} else if (argument.type === 'ObjectExpression') {
258-
result = result || (type === 'object');
258+
result = result || (type === 'object' || type === 'class');
259259

260260
} else if (argument.type === 'ArrayExpression') {
261261
result = result || (type === 'array');

test/lib/rules/validate-jsdoc/check-return-types.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,17 @@ describe('rules/validate-jsdoc', function () {
245245
}
246246
};
247247
}
248+
}, {
249+
it: 'should not report on `@returns {Class}` for {}. issue #32',
250+
code: function () {
251+
/**
252+
* @return {Class}
253+
*/
254+
Users.prototype.getState = function()
255+
{
256+
return {};
257+
};
258+
}
248259
}
249260
/* jshint ignore:end */
250261
]);

0 commit comments

Comments
 (0)