Skip to content

Commit 4049db1

Browse files
committed
fix(check-syntax, implements-on-classes): report error line numbers
1 parent 37081d2 commit 4049db1

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

src/rules/checkSyntax.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default iterateJsdoc(({
1010

1111
for (const tag of jsdoc.tags) {
1212
if (tag.type.slice(-1) === '=') {
13-
report('Syntax should not be Google Closure Compiler style.');
13+
report('Syntax should not be Google Closure Compiler style.', null, tag);
1414
break;
1515
}
1616
}

src/rules/implementsOnClasses.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ export default iterateJsdoc(({
1414
return;
1515
}
1616

17-
if (utils.hasTag('implements')) {
18-
report('@implements used on a non-constructor function');
19-
}
17+
utils.forEachPreferredTag('implements', (tag) => {
18+
report('@implements used on a non-constructor function', null, tag);
19+
});
2020
}, {
2121
meta: {
2222
type: 'suggestion'

test/rules/assertions/checkSyntax.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default {
1111
`,
1212
errors: [
1313
{
14+
line: 3,
1415
message: 'Syntax should not be Google Closure Compiler style.'
1516
}
1617
]

test/rules/assertions/implementsOnClasses.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default {
1111
`,
1212
errors: [
1313
{
14+
line: 3,
1415
message: '@implements used on a non-constructor function'
1516
}
1617
]

0 commit comments

Comments
 (0)