Skip to content

Latest commit

 

History

History
63 lines (49 loc) · 1.42 KB

File metadata and controls

63 lines (49 loc) · 1.42 KB

reject-any-type

Reports use of any (or *) type within JSDoc tag types.

Context everywhere
Tags augments, class, constant, enum, implements, member, module, namespace, param, property, returns, throws, type, typedef, yields
Aliases constructor, const, extends, var, arg, argument, prop, return, exception, yield
Closure-only package, private, protected, public, static
Recommended true
Settings mode
Options

Failing examples

The following patterns are considered problems:

/**
 * @param {any} abc
 */
function quux () {}
// Message: Prefer a more specific type to `any`

/**
 * @param {*} abc
 */
function quux () {}
// Message: Prefer a more specific type to `*`

/**
 * @param {string|Promise<any>} abc
 */
function quux () {}
// Message: Prefer a more specific type to `any`

/**
 * @param {Array<*>|number} abc
 */
function quux () {}
// Message: Prefer a more specific type to `*`

Passing examples

The following patterns are not considered problems:

/**
 * @param {SomeType} abc
 */
function quux () {}