jsdoc/require-property Correctness
What it does
Requires that all @typedef and @namespace tags have @property tags when their type is a plain object, Object, or PlainObject.
Note: this rule can be configured via jsdoc settings option.
Why is this bad?
Object type should have properties defined.
Examples
Examples of incorrect code for this rule:
javascript
/**
* @typedef {Object} SomeTypedef
*/
/**
* @namespace {Object} SomeNamesoace
*/Examples of correct code for this rule:
javascript
/**
* @typedef {Object} SomeTypedef
* @property {SomeType} propName Prop description
*/
/**
* @typedef {object} Foo
* @property someProp
*/How to use
To enable this rule in the CLI or using the config file, you can use:
bash
oxlint --deny jsdoc/require-property --jsdoc-pluginjson
{
"plugins": ["jsdoc"],
"rules": {
"jsdoc/require-property": "error"
}
}