Skip to content

@returns {string|null} or @returns{?string} do not allow "return null" #8

@ronkorving

Description

@ronkorving

When my JSDoc contains * @returns {string|null} or * @returns {?string}, a return null; statement in the following function is not allowed, giving me:

Wrong returns value at lib/myfile.js :
    57 |MyClass.prototype.getIp = function (version) {
    58 | if (!this.addresses) {
    59 |  return null;
-----------------^

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions