Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix unresolved function inspection in WebStorm 10

I'm using WebStorm 10.

When I use some lib like bluebird that make code like

var foo = require("foo"); // I will call foo.doSomething
Promise.promisifyAll(foo); 

foo.doSomethingAsync(...).then(...)

the doSomethingAsync will be marked as unresolved function inspection.

So what can I do something like config *Async in WebStorm to avoid unresolved function mark?

like image 735
bonborist Avatar asked May 29 '15 02:05

bonborist


Video Answer


1 Answers

Best solution at the time is use namespace reserving. Webstorm supports using comments in order to mark stuff as legitimate:

    /** @namespace foo.doSomethingAsync */

    var foo =     Promise.promisifyAll(require('foo')); 
    foo.doSomethingAsync(...)
       .then(...)

This doesn't solve the actual issue, and won't get you suggestions for the arguments when using the function, but it's surely a convenience, helping clean up the insane amount of warnings generated when promisifying.

I hope this helps..

like image 140
Selfish Avatar answered Nov 07 '22 08:11

Selfish