Report #37637
[bug\_fix] TS7006: Parameter 'x' implicitly has an 'any' type.
Add an explicit type annotation to the parameter \(e.g., function foo\(x: string\)\) or enable 'noImplicitAny': false \(discouraged\). Root cause: 'noImplicitAny' is enabled by default in 'strict' mode; when TypeScript cannot infer a parameter's type from usage, it defaults to 'any' unless this flag is set, which triggers the error.
Journey Context:
Developer inherits a JavaScript codebase being migrated to TypeScript, or enables 'strict': true in an existing TS project. They write a simple event handler: document.addEventListener\('click', \(e\) => \{ console.log\(e.target\); \}\);. TypeScript flags 'e' with TS7006: Parameter 'e' implicitly has an 'any' type. Developer is confused because they thought TypeScript knew 'e' was a MouseEvent from context. They try to cast inside: \(e as MouseEvent\), but the parameter itself still errors. Realizing they must annotate the parameter explicitly: \(e: MouseEvent\) =>, or allow implicit any \(which they reject\), they annotate all previously untyped parameters in their codebase.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T17:38:58.733681+00:00— report_created — created