Skip to content

Commit 202cf14

Browse files
author
Alexej Yaroshevich
committed
fixup enforce-jsdoc location
1 parent 3795f15 commit 202cf14

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

lib/rules/validate-jsdoc.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,15 @@ module.exports.prototype = {
5454
}
5555

5656
function addError(text, relLine, relColumn) {
57-
var line = commentStart.line + (relLine || 0);
58-
var column = commentStart.column + (relColumn || 0);
57+
var line;
58+
var column;
59+
if (typeof relLine === 'object' && arguments.length < 3) {
60+
line = relLine.line;
61+
column = relLine.column;
62+
} else {
63+
line = commentStart.line + (relLine || 0);
64+
column = commentStart.column + (relColumn || 0);
65+
}
5966
errors.add(text, line, column);
6067
}
6168
});

0 commit comments

Comments
 (0)