jsconfig.json option

noImplicitAny

  • Default false
  • Tested with TypeScript 5.9

When TypeScript cannot tell a value's type and has nothing to infer it from, it gives up with any, which turns checking off for that value. noImplicitAny makes that an error instead. In a JavaScript file the usual case is a function parameter without a JSDoc type, reported as TS7006.

It is part of strict and reports more in a typical JavaScript codebase than any other member of the family, which makes it a good first step on its own.

At a glance

Write Leave it to strict, or write "noImplicitAny": true on its own as the first step on an existing codebase
On the command line --noImplicitAny
Type boolean
Default in TypeScript 5.9 false (on when strict is on)
Default from TypeScript 6.0 true, through strict (TypeScript 6.0)
TypeScript's description Enable error reporting for expressions and declarations with an implied 'any' type.

The description is quoted from TypeScript's own option list (Apache-2.0); see the notices.

Examples

main.js Error confirmed 5.9.3 TypeScript 5.9.3, run 21 October 2026: main.js(2,23): error TS7006: Parameter 'items' implicitly has an 'any' type. main.js(4,24): error TS7006: Parameter 'sum' implicitly has an 'any' type. main.js(4,29): error TS7006: Parameter 'item' implicitly has an 'any' type. 6.0.3 TypeScript 6.0.3, run 21 October 2026: the same as 5.9.3. main.js(2,23): error TS7006: Parameter 'items' implicitly has an 'any' type. main.js(4,24): error TS7006: Parameter 'sum' implicitly has an 'any' type. main.js(4,29): error TS7006: Parameter 'item' implicitly has an 'any' type. 7.0.2 TypeScript 7.0.2, run 21 October 2026: the same as 5.9.3. main.js(2,23): error TS7006: Parameter 'items' implicitly has an 'any' type. main.js(4,24): error TS7006: Parameter 'sum' implicitly has an 'any' type. main.js(4,29): error TS7006: Parameter 'item' implicitly has an 'any' type. checked 21 October 2026
export function total(items) {error TS7006: Parameter 'items' implicitly has an 'any' type.
  return items.reduce((sum, item) => sum + item.price, 0);error TS7006: Parameter 'sum' implicitly has an 'any' type.error TS7006: Parameter 'item' implicitly has an 'any' type.
}
noImplicitAny on (through strict): untyped parameters are errors.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "target": "es2022",
    "module": "nodenext",
    "types": []
  },
  "include": [
    "*.js"
  ]
}
main.js TypeScript 5.9.3 TypeScript 5.9.3, run 21 October 2026: No errors. 6.0.3 TypeScript 6.0.3, run 21 October 2026: the same as 5.9.3. No errors. 7.0.2 TypeScript 7.0.2, run 21 October 2026: the same as 5.9.3. No errors. checked 21 October 2026
export function total(items) {
  return items.reduce((sum, item) => sum + item.price, 0);
}
noImplicitAny off: they are any, silently.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "target": "es2022",
    "module": "nodenext",
    "types": [],
    "noImplicitAny": false
  },
  "include": [
    "*.js"
  ]
}

What it reports in a .js file

The common ones:

  • a parameter with no @param type and no default value (TS7006), including callback parameters when the array they come from is itself untyped, as in the example
  • a destructured parameter with no type (TS7031)
  • an import of a JavaScript package with no types (TS7016); see maxNodeModuleJsDepth

Variables that start empty

A variable that starts as null, undefined or [] is not left silently any under strict: TypeScript 5.9 follows what is assigned to it. Reading a.length after let a = null is TS18047, and an empty array the checker cannot follow, because a closure captures it, is TS7034. With strict off, such variables are any. Annotate them with @type when the type matters, for example /** @type {string[]} */ const names = [];.

Gotchas

  • A parameter with a default value is typed from the default (function f(n = 0) makes n a number), so it is not reported.
  • An explicit {any} in JSDoc is not "implicit" and is never reported; it is a deliberate opt-out.

Questions

Do I have to type every parameter?

Every parameter TypeScript cannot type from context. Callbacks passed to typed functions ([1, 2].map((n) => n * 2)) get their types from the function they are passed to and need no JSDoc.

Sources

Last reviewed 20 October 2026.