Unable to get JOI functions to resolve in Inspector

I have tried everything I can think of to get WebStorm to include the JOI package in my node.js project without throwing inspection warnings when I use its function. It works fine the way I have it written and causes no runtime errors. I have tried updating it, as well as explicitly installing it in "Preferences > Languages and Frameworks > Javascript > Libraries"

All of my other libraries I have installed through NPM behave fine and do not cause any inspector errors. However a simple statement like:

joi.string()

Causes an "Unresolved function or method string()" warning

How do I get rid of this? I have a whole file of validation using JOI so ignoring this line by line is not an options

0

Works fine for me after installing joi typings via Install TypeScript definitions for better type information intention (see https://www.jetbrains.com/help/webstorm/2019.3/configuring-javascript-libraries.html#ws_jsconfigure_libraries_ts_definition_files):

 

0

Hi,

Unfortunately it is not working for newer version of joi. Using @hapi/joi version 17.1.0.

I added every joi related library in the above mentioned way but none of it worked...

0

请先登录再写评论。