Skip to content

JSDoc type parameter {object|boolean}: error in object properties #61612

Closed as not planned
@regseb

Description

@regseb

πŸ”Ž Search Terms

jsdoc, ts8032, destructuring, object

πŸ•— Version & Regression Information

This is the behavior in every version I tried, and I reviewed the FAQ for entries about jsdoc

⏯ Playground Link

https://www.typescriptlang.org/play/?filetype=js#code/PQKhCgAIUgxB7eA6KFqQAIAcCGAnHAW0gG94AjAKwFMBjAFwB9zEAbanAOwF9Jz9IgoZABC+FOmz4ipAM708AS04BzXsOEBtfniT8AXgF1ROfRJDBwteJ3mQAZokgBeSAAodAShcA+UlCFrW3h2JFZ4FQ98TwBucG448Ed4NwUAV2pYpMQ3Ej5TAC5IACIARzSAD2LIbligA

πŸ’» Code

/**
 * Foo.
 *
 * @param {object|boolean} bar       Bar.
 * @param {string}         [bar.baz] Baz.
 */
const foo = (bar) => {
    console.log(bar);
};

foo(true);
foo({ baz: "qux" });

πŸ™ Actual behavior

Qualified name 'bar.baz' is not allowed without a leading '@param {object} bar'.

πŸ™‚ Expected behavior

No error.

Additional information about the issue

When JSDoc describes a parameter with an object or another type (eg. {object|boolean}): it's not possible to describe object properties.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Not a DefectThis behavior is one of several equally-correct options

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions