File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -64,9 +64,10 @@ export default iterateJsdoc(({
64
64
}
65
65
66
66
// In case the code returns something, we expect a return value in JSDoc.
67
- if ( ! utils . hasDefinedTypeReturnTag ( tags [ 0 ] ) && (
68
- utils . isForceRequireReturn ( ) || utils . hasReturnValue ( )
69
- ) ) {
67
+ const [ tag ] = tags ;
68
+ if ( ! utils . hasDefinedTypeReturnTag ( tag ) && utils . hasReturnValue ( ) ||
69
+ ( typeof tag === 'undefined' || tag === null ) && utils . isForceRequireReturn ( )
70
+ ) {
70
71
report ( 'Missing JSDoc @' + tagName + ' declaration.' ) ;
71
72
}
72
73
} , {
Original file line number Diff line number Diff line change @@ -408,6 +408,20 @@ export default {
408
408
}
409
409
}
410
410
`
411
+ } ,
412
+ {
413
+ code : `
414
+ /**
415
+ * @returns {void}
416
+ */
417
+ function quux () {
418
+ }
419
+ ` ,
420
+ settings : {
421
+ jsdoc : {
422
+ forceRequireReturn : true
423
+ }
424
+ }
411
425
}
412
426
]
413
427
} ;
You can’t perform that action at this time.
0 commit comments