Setup
// test.js
module.exports = {
/**
* @return {foo.Bar}
*/
foo: function () {
return new foo.Bar();
}
};
// .jscsrc
{
"additionalRules": [
"node_modules/jscs-jsdoc/lib/rules/*.js"
],
"jsDoc": {
"checkParamNames": true,
"checkRedundantParams": true,
"requireParamTypes": true,
"checkReturnTypes": true,
"requireReturnTypes": true,
"checkTypes": true,
"checkRedundantReturns": true,
"checkRedundantAccess": true,
"leadingUnderscoreAccess": "private",
"enforceExistence": true
}
}
// command line
node_modules/jscs/bin/jscs --config .jscsrc test.js
Output
TypeError: Cannot call method 'toLowerCase' of undefined
at Object.jsDocMatchType [as match] (/home/pigulla/node_modules/jscs-jsdoc/lib/jsdoc-helpers.js:222:87)
at /home/pigulla/node_modules/jscs-jsdoc/lib/rules/validate-jsdoc/returns.js:74:31
at Array.forEach (native)
at Object.validateReturnsTag (/home/pigulla/node_modules/jscs-jsdoc/lib/rules/validate-jsdoc/returns.js:73:35)
at /home/pigulla/node_modules/jscs-jsdoc/lib/jsdoc-helpers.js:72:23
at Array.forEach (native)
at Object.jsDocForEachTag [as forEachTag] (/home/pigulla/node_modules/jscs-jsdoc/lib/jsdoc-helpers.js:39:24)
at Object.<anonymous> (/home/pigulla/node_modules/jscs-jsdoc/lib/jsdoc-helpers.js:70:20)
at /home/pigulla/node_modules/jscs-jsdoc/lib/rules/validate-jsdoc.js:53:37
at Array.forEach (native)
Setup
Output