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
- Add an explicit type to the parameter
ts
items.map((item: Item) => item.id)Give the surrounding value a type so inference works
- Type the array/function so the callback parameter is inferred
- 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
TS7053: Element implicitly has an any type (index signature) - in CIFix "error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to…
TS7031: Binding element implicitly has an any type - in CIFix "error TS7031: Binding element 'x' implicitly has an 'any' type" under noImplicitAny - annotate a destruc…
TS2345: Argument is not assignable - in CIFix "error TS2345: Argument of type 'X' is not assignable to parameter of type 'Y'" when tsc runs in CI - a t…