🟦 TypeScript errors

TypeScript compiler errors (TS2322, TS2345, TS7006…) explained with fixes for strict mode, generics and type declarations.

CodeErrorWhat it means
TS2322 TS2322: Type 'X' is not assignable to type 'Y' You assigned a value whose type doesn’t match the declared type of the variable, property or return value.
TS2564 TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor With strictPropertyInitialization on, a class property declared without ? or a default isn’t set in the const…
TS7006 TS7006: Parameter 'x' implicitly has an 'any' type A function parameter has no type annotation and TypeScript can’t infer one, which noImplicitAny (part of stri…