Skip to content

Commit

Permalink
fix(require-jsdoc): proper reporting of end line numbers; fixes #843
Browse files Browse the repository at this point in the history
  • Loading branch information
brettz9 committed Apr 20, 2022
1 parent 7db1920 commit 4270b75
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/rules/requireJsdoc.js
Expand Up @@ -320,8 +320,13 @@ export default {
};

const report = () => {
const {
start,
} = node.loc;
const loc = {
end: node.loc.start + 1,
end: {
line: start.line + 1,
},
start: node.loc.start,
};
context.report({
Expand Down
5 changes: 3 additions & 2 deletions test/rules/assertions/requireJsdoc.js
Expand Up @@ -226,7 +226,8 @@ function quux (foo) {
}`,
errors: [
{
endLine: undefined,
column: 1,
endLine: 3,
line: 2,
message: 'Missing JSDoc comment.',
},
Expand Down Expand Up @@ -699,7 +700,7 @@ function quux (foo) {
}`,
errors: [
{
endLine: undefined,
endLine: 3,
line: 2,
message: 'Missing JSDoc comment.',
},
Expand Down

0 comments on commit 4270b75

Please sign in to comment.