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
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.
}jsconfig.json for this example
{
"compilerOptions": {
"checkJs": true,
"noEmit": true,
"strict": true,
"target": "es2022",
"module": "nodenext",
"types": []
},
"include": [
"*.js"
]
} export function total(items) {
return items.reduce((sum, item) => sum + item.price, 0);
}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
@paramtype 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)makesnanumber), 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
- TSConfig Reference: noImplicitAny · TypeScript
- Type Checking JavaScript Files · TypeScript handbook
Last reviewed 20 October 2026.