Skip to content

no-wrapper-object-types

Reports the global types BigInt, Boolean, Number, Object, String and Symbol used as type names. The lower-case primitives are not reported.

String and the like are the types of the wrapper objects (new String('a')), not of the primitive values, and a primitive is assignable to them only by accident of the language. Object accepts every value except null and undefined, numbers and strings included.

To fix, write string, number, boolean, bigint or symbol; for any non-primitive value write object.

Reported
...
let s: String;
let t: string;
js:
lint:
rules:
no-wrapper-object-types: warn # off (default), warn, error

Enabled by the presets: js/typescript-eslint-recommended, js/biome-recommended, js/oxlint.

Suppress one line with sudsy-disable-next-line no-wrapper-object-types in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
typescript-eslint no-wrapper-object-types full