TS7006

error TS7006: Parameter ‘person‘ implicitly has an ‘any‘ type.

Broken Code ❌

main.ts
1
2
3
function greeter(person) {
return `Hello, ${person}`;
}
tsconfig.json
1
2
3
4
5
{
"compilerOptions": {
"noImplicitAny": true
}
}

Fixed Code ✔️

You have to define the type for the argument named person:

main.ts
1
2
3
function greeter(person: string) {
return `Hello, ${person}`;
}

Alternative, but not recommend: