Skip to content

Latest commit

 

History

History
79 lines (60 loc) · 1.68 KB

require-property-name.md

File metadata and controls

79 lines (60 loc) · 1.68 KB

require-property-name

Requires that all @property tags have names.

Context and settings

Context everywhere
Tags property
Aliases prop
Recommended true

Failing examples

The following patterns are considered problems:

/**
 * @typedef {SomeType} SomeTypedef
 * @property
 */
// Message: There must be an identifier after @property type.

/**
 * @typedef {SomeType} SomeTypedef
 * @property {string}
 */
// Message: There must be an identifier after @property tag.

/**
 * @typedef {SomeType} SomeTypedef
 * @property foo
 */
// Settings: {"jsdoc":{"tagNamePreference":{"property":false}}}
// Message: Unexpected tag `@property`

Passing examples

The following patterns are not considered problems:

/**
 * @typedef {SomeType} SomeTypedef
 * @property foo
 */

/**
 * @typedef {SomeType} SomeTypedef
 * @property {string} foo
 */

/**
 * @namespace {SomeType} SomeName
 * @property {string} foo
 */

/**
 * @class
 * @property {string} foo
 */