no-wrapper-object-types
What it does
Section titled “What it does”Reports the global types BigInt, Boolean, Number, Object, String and Symbol used as type names. The lower-case primitives are not reported.
Why it matters
Section titled “Why it matters”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.
Example
Section titled “Example”...let s: String;let t: string;Configuration
Section titled “Configuration”js: lint: rules: no-wrapper-object-types: warn # off (default), warn, errorEnabled 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.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| typescript-eslint | no-wrapper-object-types |
full |