TypeScript ESLint for Visual Studio Code misinterprets my types

  Kiến thức lập trình

I don’t know if other people had this issue before, but this is very anoying. I keep getting type errors in my UI telling my I have problems with an any type, but the variable is actually typed as a string, or any other type. Is like eslint is not recognizing the correct type and it shows me an error.
This is an example, but it happens in many places through out the code.
function with correct string typed parameter

error telling me my parameter is typed as any

When I specify the type again it works, but this should not be like this, as the function already have the types specified.
unecessary type

New contributor

Mike B. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT