Skip to content

check-types message for @returns has empty string for some reason #103

@brettz9

Description

@brettz9

With jsdoc/check-types, I'm getting the message:

Invalid JSDoc @returns "" type "object".

The empty string there comes from jsdocTag.name within this line of src/rules/checkTypes.js:

report('Invalid JSDoc @' + jsdocTag.tag + ' "' + jsdocTag.name + '" type "' + invalidType + '".', fix, jsdocTag);

I assume that this may apply to the likes of name obtained from your call to https://github.com/yavorskiy/comment-parser , though in the case of @returns a name is not expected, so this doesn't really fit here I think (and though, off topic somewhat, I don't know why I'm not seeing at least "A" being passed as the name here when the line flagging this rule is * @returns {object} A color object).

(FWIW, I tried debugging comment-parser at https://npm.runkit.com/comment-parser .)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions