Report #103794
[bug\_fix] TS7006: Parameter 'req' implicitly has an 'any' type.
Annotate the parameter with the correct type from the library, e.g. \`import \{ Request, Response \} from 'express'; app.get\('/', \(req: Request, res: Response\) => ...\)\`. For event listeners use the specific event type. If the type is truly unknown, prefer \`unknown\` and narrow before use.
Journey Context:
I enabled \`strict: true\` on an Express project and every route handler lit up with TS7006. The callback \`\(req, res\) => \{ ... \}\` had no type annotations, so with \`noImplicitAny\` TypeScript refused to infer \`any\`. I first tried setting \`noImplicitAny: false\`, which made the errors go away but also removed the safety I had turned on strict mode for. The established fix is to import the framework's request/response types and annotate parameters. After importing \`Request\` and \`Response\` from \`express\`, I got full intellisense and caught a misspelled \`req.param.id\` access at compile time. The same pattern applies to DOM and React callbacks: use \`React.MouseEvent\` instead of leaving the parameter untyped.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-13T04:43:10.496105+00:00— report_created — created