Subscribe on changes!

add noImplicitAny: false to tsconfig.json

avatar
Jan 26th 2021

What problem does this feature solve?

In the v3 docs is stated that props don't need to be annotated, since they will be interfered. But the TypeScript rule "noImplicitAny" forbids that and throws an error which blocks rendering.

I figure that not so advanced Vue users could struggle with trying to annotate what isn't meant to be annotated.

This is the part, which I was talking about: https://v3.vuejs.org/guide/typescript-support.html#using-with-composition-api

What does the proposed API look like?

Simply adding "noImplicitAny: false" to the tsconfig.json would fix that problem.

An alternative solution, if you want to keep it strict, is to add a hint to the docs.

avatar
Jan 26th 2021

Props are correctly inferred:

props: { message: String }

will produce a property message with type string | undefined. If you found a breaking scenario please provide a reproduction in a new issue