@@ -464,26 +464,29 @@ const hasATag = (jsdoc, targetTagNames) => {
464464} ;
465465
466466/**
467- * Checks if the JSDoc comment declares a defined type.
467+ * Checks if the JSDoc comment has an undefined type.
468468 *
469469 * @param {JsDocTag } tag
470470 * the tag which should be checked.
471471 * @param {"jsdoc"|"closure"|"typescript" } mode
472472 * @returns {boolean }
473- * true in case a defined type is declared ; otherwise false.
473+ * true in case a defined type is undeclared ; otherwise false.
474474 */
475- const hasDefinedTypeTag = ( tag , mode ) => {
475+ const mayBeUndefinedTypeTag = ( tag , mode ) => {
476476 // The function should not continue in the event the type is not defined...
477477 if ( typeof tag === 'undefined' || tag === null ) {
478- return false ;
478+ return true ;
479479 }
480480
481481 // .. same applies if it declares an `{undefined}` or `{void}` type
482482 const tagType = tag . type . trim ( ) ;
483483
484484 // Exit early if matching
485- if ( tagType === 'undefined' || tagType === 'void' ) {
486- return false ;
485+ if (
486+ tagType === 'undefined' || tagType === 'void' ||
487+ tagType === '*' || tagType === 'any'
488+ ) {
489+ return true ;
487490 }
488491
489492 let parsedTypes ;
@@ -506,11 +509,11 @@ const hasDefinedTypeTag = (tag, mode) => {
506509 return elem . type === 'JsdocTypeUndefined' ||
507510 elem . type === 'JsdocTypeName' && elem . value === 'void' ;
508511 } ) ) {
509- return false ;
512+ return true ;
510513 }
511514
512515 // In any other case, a type is present
513- return true ;
516+ return false ;
514517} ;
515518
516519/**
@@ -1239,7 +1242,6 @@ export default {
12391242 getTagsByType,
12401243 getTagStructureForMode,
12411244 hasATag,
1242- hasDefinedTypeTag,
12431245 hasParams,
12441246 hasReturnValue,
12451247 hasTag,
@@ -1251,6 +1253,7 @@ export default {
12511253 isNamepathDefiningTag,
12521254 isSetter,
12531255 isValidTag,
1256+ mayBeUndefinedTypeTag,
12541257 overrideTagStructure,
12551258 parseClosureTemplateTag,
12561259 pathDoesNotBeginWith,
0 commit comments