Skip to content
Latchkey

TS7006: Parameter implicitly has an any type - in CI

With noImplicitAny on, a parameter has no annotation and tsc cannot infer its type.

What this error means

Type-checking fails with TS7006 naming an unannotated parameter, commonly in a callback.

tsc
src/map.ts(4,18): error TS7006: Parameter 'item' implicitly has an 'any' type.

Common causes

How to fix it

Annotate the parameter

  1. Add an explicit type to the parameter
ts
items.map((item: Item) => item.id)

Give the surrounding value a type so inference works

  1. Type the array/function so the callback parameter is inferred
  2. Avoid blanket any to silence it
ts
const items: Item[] = data
items.map((item) => item.id)

How to prevent it

  • Keep noImplicitAny on and type containers so callbacks get contextual types automatically.

Frequently asked questions

What causes "TS7006 parameter implicitly any"?
Type-checking fails with TS7006 naming an unannotated parameter, commonly in a callback.
How do I fix TS7006 parameter implicitly any?
Annotate the parameter

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card