# TypeScript: “Parameter 'x' implicitly has an 'any' type” (TS7006, TS7016, TS7053)

> TS7006 Parameter implicitly has an any type, TS7016 Could not find a declaration file for module, TS7053 Element implicitly has an any type. The fix for each.

Canonical: https://app369.com/fix/typescript-implicitly-has-an-any-type/
Last updated: 2026-11-08

With noImplicitAny on (it is part of strict), TypeScript refuses to guess any. It shows up as Parameter 'e' implicitly has an 'any' type (TS7006), Could not find a declaration file for module 'x' ... implicitly has an 'any' type (TS7016), or Element implicitly has an 'any' type because expression of type 'string' can't be used to index type (TS7053). Each has its own fix.

**Short answer**

For a parameter, add a type annotation (or let it be inferred by passing the function where a typed callback is expected). For a module, install its types (npm install -D @types/name) or, if none exist, declare the module in a .d.ts file. For an index error, type the object as a Record or narrow the key with keyof typeof. Turning off noImplicitAny makes the message go away but removes the checking it gives you.

## **Which variant it is, and the fix**

1. 01 ### **TS7006: a parameter without a type**
  > “In some cases where no type annotations are present, TypeScript will fall back to a type of any for a variable when it cannot infer the type.” [**TypeScript, TSConfig: noImplicitAny**](https://www.typescriptlang.org/tsconfig/#noImplicitAny) A standalone function or a callback stored in an unannotated variable has nothing to infer its parameter types from. Annotate them. Inline callbacks passed to typed functions (map, addEventListener, onClick) get their types automatically.```
function total(items: { price: number }[]) {
  return items.reduce((sum, item) => sum + item.price, 0);
}
```
2. 02 ### **TS7016: a package without types**
  > “Definitions on DefinitelyTyped are also automatically published to npm under the @types scope.” [**TypeScript, Type declarations: DefinitelyTyped**](https://www.typescriptlang.org/docs/handbook/2/type-declarations.html) The package ships plain JavaScript. Install the community types if they exist; otherwise declare the module yourself so the import is typed as any on purpose.```
npm install -D @types/lodash

// src/types/untyped.d.ts (when no @types package exists)
declare module 'some-untyped-lib';  // in a .d.ts that tsconfig includes, with no top-level import or export
```
3. 03 ### **TS7053: indexing an object with a string** obj[key] with key: string fails when obj has a fixed set of keys. Narrow the key to those keys, or type the object as a lookup table.```
const labels = { draft: 'Draft', sent: 'Sent' };
function label(status: keyof typeof labels) {
  return labels[status];
}

const counts: Record<string, number> = {};
```
4. 04 ### **Why not turn noImplicitAny off**
  > “Use the compiler flag noImplicitAny to flag any implicit any as an error.” [**TypeScript, Everyday types: any**](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html) It is on in every strict project for a reason: an implicit any silently disables type checking for everything that touches that value. Fix the few spots instead.

Checked against the vendor’s docs on November 8, 2026: [TSConfig: noImplicitAny](https://www.typescriptlang.org/tsconfig/#noImplicitAny); [TypeScript Handbook: Type declarations](https://www.typescriptlang.org/docs/handbook/2/type-declarations.html); [TypeScript Handbook: Everyday types](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html).

## **Rather hand it over?**

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

- [from $450**App Fix Ticket**One reproducible bug in an existing mobile or web app, diagnosed and fixed.**See scope and start**](https://app369.com/fixed-price/flutter-firebase-bug-fix/)
- [from $450**AI-Built App Rescue**A Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.****No issues worth fixing, no charge.**** If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.**See scope and start**](https://app369.com/fixed-price/ai-app-rescue/)

Related: [**TypeScript “Cannot find name”**](https://app369.com/fix/typescript-cannot-find-name/) · [**TypeScript “Argument of type is not assignable to parameter”**](https://app369.com/fix/typescript-argument-of-type-is-not-assignable-to-parameter/) · [**TypeScript “Property does not exist on type”**](https://app369.com/fix/typescript-property-does-not-exist-on-type/)

Questions

## **More on this error**

<details>

<summary>**Why does it appear after upgrading or enabling strict? **+</summary>

strict turns on noImplicitAny along with other checks. Code that compiled before had untyped spots that TypeScript treated as any without telling you.

</details>

<details>

<summary>**Is unknown better than any? **+</summary>

For values you truly cannot type, yes. unknown forces a check before use, while any switches checking off.

</details>

<details>

<summary>**Can you fix it for me? **+</summary>

If one bug is the whole problem, the App Fix Ticket covers it: a written diagnosis first, then the fix. If the app has more going on, the Launch Check is a written check of the whole app. Each issue found is rated critical, high, medium or low, with where it is and how it was confirmed. No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.

</details>

A different error?

## **Describe it and get a written quote**

Send the error and what you were doing. You get a written scope, a fixed price and a timeline; Simon replies by email, usually within one business day.

[**Describe your problem **→](https://app369.com/contact/) [**All fixes**](https://app369.com/fix/)