toLowerCase() function / method not found

Not sure if I need a specific type library, but most String.prototype functions built into JS are marking themselves as not found. For example:


Does it work if you write


Also, did you try invalidating caches?



I tried invalidating the cache and restarting, didn't change it. 

I tried console.log('HELLO'.toLowerCase()); And it does work, so it must not like that I'm applying it to a variable?


Seems that it doesn't correctly infer email type (it has no clue what parameter type is expected and may resolve it by name to some existing function in your app). Try ctrl+clicking on email - what definition are you taken to?


When I tried ctrl + clicking it to find the parameter definition it does nothing. I installed the type library for passport, as well as passport local, so I'm unsure why it thinks that. Email is defined as a string in the User Schema (which is in the Model folder, as it should be). Is there a way I can get it to infer that it's a string? 


You can try using inline JsDoc annotations, like


you need ading the annotation to your callback declaration

(/*string*/email, password, done) => (...

That worked! Thank you! Never used jsDoc annotations before, thanks! 


Please sign in to leave a comment.