I tried in both Webstorm 6 and 7 EAP,
Auto-completion works fine but something strange happened,
var SyParams = require('../params');
....
SyParams.kioskParams ( IDE gives warning, 'unresolved variable kioskParams' )
If I write 'require' like this;
var SyParams = new require('../params');
Everything looks good, is there a solution for that ?
It seems that the '..\params' module is exporting a constructor function that constructs an object which has kioskParams as an attribute. And the constructor itself doesn't have an attribute called kioskParams.
It can be easier understood if you write it like this:
var SyParams = require('../params'); // The module exports a constructor
...
var syParams = new SyParams(); // You construct the actual object
syParams.kioskParams; //Then you access its members
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With