ProjectStack
typescript

TS7006: Parameter 'X' implicitly has an 'any' type

A function parameter lacks a type annotation and TypeScript can't infer its type from context. With noImplicitAny or strict enabled in tsconfig.json, TypeScript requires you to explicitly annotate parameters rather than silently treating them as any.

Common causes

  • Writing a function parameter without a type annotation: function fn(x) — x is implicitly any
  • strict: true or noImplicitAny: true is set in tsconfig.json
  • Callback functions passed to methods where TypeScript can't infer the parameter type from context
  • Migrating JavaScript code to TypeScript without adding type annotations

How to fix it

  1. Add a type annotation to the parameter: function fn(x: string) { ... }
  2. If you genuinely need any, annotate it explicitly: function fn(x: any) — this is intentional
  3. Use a generic if the type varies: function fn<T>(x: T) { ... }
  4. Set noImplicitAny: false in tsconfig.json to disable this check (not recommended for new projects)

Example

function double(x) { return x * 2; } // error TS7006: Parameter 'x' implicitly has an 'any' type.

Function parameter without a type annotation with noImplicitAny enabled

Browse more errors

The Developer Hub covers 150+ errors across Git, npm, Node.js, Python, TypeScript, and Docker — with plain-English explanations and fix steps.