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
- Add a type annotation to the parameter: function fn(x: string) { ... }
- If you genuinely need any, annotate it explicitly: function fn(x: any) — this is intentional
- Use a generic if the type varies: function fn<T>(x: T) { ... }
- 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.
