TSConfig
noImplicitAny
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.
This can cause some errors to be missed, for example:
tsTry
functionfn (s ) {// No error?console .log (s .subtr (3));}fn (42);
Turning on noImplicitAny
however TypeScript will issue an error whenever it would have inferred any
:
tsTry
functionParameter 's' implicitly has an 'any' type.7006Parameter 's' implicitly has an 'any' type.fn () { s console .log (s .subtr (3));}