- Why is the same callback fine in one place and an error in another?
- Contextual typing. When the callback is passed to something with a known signature, its parameters are inferred; when it is declared standalone and passed later, there is nothing to infer from at the point of declaration.
- Is annotating with any acceptable to move on?
- It compiles, but it silently disables checking for every use of that value.
unknown is the better placeholder — it also compiles, and it forces a check before use, so the compiler keeps helping you. - Should I use noImplicitAny without full strict?
- You can, and it is the single most valuable of the strict family. But strictNullChecks catches a whole class of runtime crashes, so treat noImplicitAny as the first step towards strict rather than the destination.