Skip to content

jsdoc/check-property-names Correctness

What it does

Ensures that property names in JSDoc are not duplicated on the same block and that nested properties have defined roots.

Why is this bad?

@property tags with the same name can be confusing and may indicate a mistake.

Examples

Examples of incorrect code for this rule:

javascript
/**
 * @typedef {object} state
 * @property {number} foo
 * @property {string} foo
 */

/**
 * @typedef {object} state
 * @property {number} foo.bar
 */

Examples of correct code for this rule:

javascript
/**
 * @typedef {object} state
 * @property {number} foo
 */

/**
 * @typedef {object} state
 * @property {object} foo
 * @property {number} foo.bar
 */

References

Released under the MIT License.