Skip to content

Commit a989204

Browse files
committed
fix(implements-on-classes): had failed to check for tag itself; added test
1 parent af32667 commit a989204

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/rules/implementsOnClasses.js

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

17-
report('@implements used on a non-constructor function');
17+
if (utils.hasTag('implements')) {
18+
report('@implements used on a non-constructor function');
19+
}
1820
}, {
1921
meta: {
2022
type: 'suggestion'

test/rules/assertions/implementsOnClasses.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ export default {
5353
}
5454
}
5555
`
56+
},
57+
{
58+
code: `
59+
/**
60+
*
61+
*/
62+
function quux () {
63+
64+
}
65+
`
5666
}
5767
]
5868
};

0 commit comments

Comments
 (0)