Implicit any errors
One great benefit of this is that you’ll see way fewer implicit any
errors when running with —noImplicitAny
.Implicit any
errors are only reported when the compiler is unable to know the type of a variable without a type annotation.
Example
function f3() {
let x = []; // Error: Variable 'x' implicitly has type 'any[]' in some locations where its type cannot be determined.
x.push(5);
function g() {
x; // Error: Variable 'x' implicitly has an 'any[]' type.
}
}