Skip to content

Latest commit

 

History

History
66 lines (48 loc) · 1.19 KB

File metadata and controls

66 lines (48 loc) · 1.19 KB

ts-no-empty-object-type

Warns against use of the empty object type which, in TypeScript, means "any value that is defined".

Options

Context everywhere
Tags ``
Recommended true
Settings
Options

Failing examples

The following patterns are considered problems:

/**
 * @param {{}} someName
 */
// Message: No empty object type.

/**
 * @param {(string|{})} someName
 */
// Message: No empty object type.

Passing examples

The following patterns are not considered problems:

/**
 * @param {{a: string}} someName
 */

/**
 * @param {({a: string} & {b: number})} someName
 */

/**
 * @param {BadType<} someName
 */

/**
 * @param {{}} someName
 */
// Settings: {"jsdoc":{"mode":"jsdoc"}}