Skip to content

Commit c56322a

Browse files
author
Alexej Yaroshevich
committed
fixed possible throw with invalid tag location
Fixes #86
1 parent 55b463e commit c56322a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

lib/rules/validate-jsdoc/require-param-types.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ module.exports.options = {
1414
function validateParamTag(node, tag, err) {
1515
// checking existance
1616
if (!tag.type) {
17-
return err('missing param type');
17+
return err('Missing param type', (tag.name ? tag.name.loc : null) || tag.loc);
1818
}
1919
}

test/lib/rules/validate-jsdoc/require-param-types.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,20 @@ describe('lib/rules/validate-jsdoc/require-param-types', function () {
101101
}
102102
};
103103
}
104+
}, {
105+
// #86
106+
it: 'should report with right location',
107+
code: function () {
108+
Cls.prototype = {
109+
/**
110+
* @param {} xxx
111+
*/
112+
run: function(xxx) {
113+
// dummy
114+
}
115+
};
116+
},
117+
errors: {column: 17, line: 3}
104118
}
105119
/* jshint ignore:end */
106120
]);

0 commit comments

Comments
 (0)