π 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.
π 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
π Actual behavior
π 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.