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.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →