TypeScript · TS0002

Use concrete input contracts instead of object

Reject function parameters typed as the broad object type.
TS0002vite-doctor/typescriptevidencewarnSuggestion

Run this rule

pnpm vite-doctor . --extends auto,typescript/strict --rules typescript/evidence/no-object-parameters

Why it matters

The object type proves only that a value is not primitive. It gives the function no usable property contract and usually postpones parsing until after the input has crossed its owner boundary.

Accept a named owner type or parse unknown input before calling the function.

Example

Name the accepted contract

Before

function save(value: object) {}

After

function save(value: SavedRecord) {}
Copyright © 2026