File tree Expand file tree Collapse file tree 3 files changed +37
-3
lines changed Expand file tree Collapse file tree 3 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -7514,6 +7514,14 @@ function quux() {
7514
7514
7515
7515
}
7516
7516
7517
+ /**
7518
+ * @callback foo
7519
+ */
7520
+ function quux () {
7521
+
7522
+ }
7523
+ // Options: [{"allowEmptyNamepaths":true}]
7524
+
7517
7525
/**
7518
7526
* @class
7519
7527
*/
@@ -7562,6 +7570,11 @@ function quux() {
7562
7570
*/
7563
7571
const FOO = ' foo' ;
7564
7572
7573
+ /**
7574
+ * @constant {string} FOO
7575
+ */
7576
+ const FOO = ' foo' ;
7577
+
7565
7578
/**
7566
7579
* @extends Foo
7567
7580
*/
Original file line number Diff line number Diff line change @@ -61,13 +61,13 @@ export default iterateJsdoc(({
61
61
return true ;
62
62
} ;
63
63
64
- const hasType = Boolean ( tag . type ) ;
64
+ const hasType = utils . tagMightHaveType ( tag . tag ) && Boolean ( tag . type ) ;
65
65
const mustHaveType = utils . tagMustHaveType ( tag . tag ) ;
66
66
67
- const hasNamePath = Boolean ( tag . name ) && ! ( tag . tag === 'see' && ! checkSeesForNamepaths ) ;
67
+ const hasNamePath = utils . tagMightHaveNamepath ( tag . tag ) && Boolean ( tag . name ) && ! ( tag . tag === 'see' && ! checkSeesForNamepaths ) ;
68
68
const mustHaveNamepath = utils . tagMustHaveNamepath ( tag . tag ) && ! allowEmptyNamepaths ;
69
69
70
- const hasEither = hasType || hasNamePath ;
70
+ const hasEither = utils . tagMightHaveEitherTypeOrNamepath ( tag . tag ) && hasType || hasNamePath ;
71
71
const mustHaveEither = utils . tagMustHaveEitherTypeOrNamepath ( tag . tag ) ;
72
72
73
73
if ( tag . tag === 'borrows' ) {
Original file line number Diff line number Diff line change @@ -336,6 +336,19 @@ export default {
336
336
}
337
337
` ,
338
338
} ,
339
+ {
340
+ code : `
341
+ /**
342
+ * @callback foo
343
+ */
344
+ function quux() {
345
+
346
+ }
347
+ ` ,
348
+ options : [ {
349
+ allowEmptyNamepaths : true ,
350
+ } ] ,
351
+ } ,
339
352
{
340
353
code : `
341
354
/**
@@ -405,6 +418,14 @@ export default {
405
418
const FOO = 'foo';
406
419
` ,
407
420
} ,
421
+ {
422
+ code : `
423
+ /**
424
+ * @constant {string} FOO
425
+ */
426
+ const FOO = 'foo';
427
+ ` ,
428
+ } ,
408
429
{
409
430
code : `
410
431
/**
You can’t perform that action at this time.
0 commit comments