Requires that all @typedef
and @namespace
tags have @property
tags when their type is a plain object
, Object
, or PlainObject
.
Note that any other type, including a subtype of object such as
object<string, string>
, will not be reported.
The fixer for require-property
will add an empty @property
.
Context | Everywhere |
Tags | typedef , namespace |
Recommended | true |
The following patterns are considered problems:
/**
* @typedef {object} SomeTypedef
*/
// Message: Missing JSDoc @property.
class Test {
/**
* @typedef {object} SomeTypedef
*/
quux () {}
}
// Message: Missing JSDoc @property.
/**
* @typedef {PlainObject} SomeTypedef
*/
// Settings: {"jsdoc":{"tagNamePreference":{"property":"prop"}}}
// Message: Missing JSDoc @prop.
/**
* @namespace {Object} SomeName
*/
// Message: Missing JSDoc @property.
The following patterns are not considered problems:
/**
*
*/
/**
* @property
*/
/**
* @typedef {Object} SomeTypedef
* @property {SomeType} propName Prop description
*/
/**
* @typedef {object} SomeTypedef
* @prop {SomeType} propName Prop description
*/
// Settings: {"jsdoc":{"tagNamePreference":{"property":"prop"}}}
/**
* @typedef {object} SomeTypedef
* @property
* // arbitrary property content
*/
/**
* @typedef {object<string, string>} SomeTypedef
*/
/**
* @typedef {string} SomeTypedef
*/
/**
* @namespace {object} SomeName
* @property {SomeType} propName Prop description
*/
/**
* @namespace {object} SomeName
* @property
* // arbitrary property content
*/
/**
* @typedef {object} SomeTypedef
* @property someProp
* @property anotherProp This with a description
* @property {anotherType} yetAnotherProp This with a type and desc.
*/
function quux () {
}