Skip to content

Typescript code with option noImplicitAny:true #3197

Answered by novemberborn
rla-dev asked this question in Q&A
Discussion options

You must be logged in to vote

I compile my Typescript tests with the compiler option noImplicitAny:true. Using tsc 4.9.5 (or 5.0.4) I get the following error:
Parameter 't' implicitly has an 'any' type.

Would be good to see the code pattern that triggers that. t is typed as ExecutionContext<Context = unknown> which isn't any.

Actually I would sometimes like to type the parameter t as follows:

  (t: ExecutionContext<MyContext>) => { ... }

I haven't found out to import AVAs ExecutionContext (import {ExecutionContext} from "ava" does work work). What did I miss?

https://github.com/avajs/ava/blob/main/docs/recipes/typescript.md#typing-tcontext

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rla-dev
Comment options

Answer selected by rla-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants