File tree Expand file tree Collapse file tree 2 files changed +67
-2
lines changed Expand file tree Collapse file tree 2 files changed +67
-2
lines changed Original file line number Diff line number Diff line change @@ -65,8 +65,9 @@ export default iterateJsdoc(({
65
65
66
66
// In case the code returns something, we expect a return value in JSDoc.
67
67
const [ tag ] = tags ;
68
- if ( ! utils . hasDefinedTypeReturnTag ( tag ) && utils . hasReturnValue ( ) ||
69
- ( typeof tag === 'undefined' || tag === null ) && utils . isForceRequireReturn ( )
68
+ const missingReturnTag = typeof tag === 'undefined' || tag === null ;
69
+ if ( missingReturnTag &&
70
+ ( utils . hasReturnValue ( ) || utils . isForceRequireReturn ( ) )
70
71
) {
71
72
report ( 'Missing JSDoc @' + tagName + ' declaration.' ) ;
72
73
}
Original file line number Diff line number Diff line change @@ -422,6 +422,70 @@ export default {
422
422
forceRequireReturn : true
423
423
}
424
424
}
425
+ } ,
426
+ {
427
+ code : `
428
+ /**
429
+ * @returns {void}
430
+ */
431
+ function quux () {
432
+ return undefined;
433
+ }
434
+ `
435
+ } ,
436
+ {
437
+ code : `
438
+ /**
439
+ * @returns {void}
440
+ */
441
+ function quux () {
442
+ return undefined;
443
+ }
444
+ ` ,
445
+ settings : {
446
+ jsdoc : {
447
+ forceRequireReturn : true
448
+ }
449
+ }
450
+ } ,
451
+ {
452
+ code : `
453
+ /**
454
+ * @returns {void}
455
+ */
456
+ function quux () {
457
+ return;
458
+ }
459
+ `
460
+ } ,
461
+ {
462
+ code : `
463
+ /**
464
+ * @returns {void}
465
+ */
466
+ function quux () {
467
+ }
468
+ ` ,
469
+ settings : {
470
+ jsdoc : {
471
+ forceRequireReturn : true
472
+ }
473
+ }
474
+ } ,
475
+ {
476
+ code : `
477
+ /**
478
+ * @returns {void}
479
+ */
480
+ function quux () {
481
+ return;
482
+ }
483
+ ` ,
484
+ settings : {
485
+ jsdoc : {
486
+ forceRequireReturn : true
487
+ }
488
+ }
425
489
}
426
490
]
427
491
} ;
You can’t perform that action at this time.
0 commit comments