Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In VSCode when exporting functions: "Individual declarations must be all exported or all local"

Tags:

I recently upgraded to Visual Studio Code 0.5.0 and some new errors cropped up that weren't there before.

I have a bunch of functions that are declared locally and then exported. Since the upgrade, however, hovering over each of the local function names produces the error Individual declarations in merged declaration functionName must be all exported or all local.

This is an example local function that is exported.

var testParamsCreatorUpdater = function (lTestParams, creatorID){     lTestParams.creator = creatorID;     return lTestParams; }; module.exports.testParamsCreatorUpdater = testParamsCreatorUpdater; 

I realize I can change this to...

module.exports.testParamsCreatorUpdater = function (lTestParams, creatorID){     lTestParams.creator = creatorID;     return lTestParams; }; 

And prepend module.exports. to every testParamsCreatorUpdater() call.

But why is the first snippet wrong? As I understand it, require() makes everything in the module.exports object available to whatever required it.

like image 339
clearwater Avatar asked Jul 08 '15 14:07

clearwater


1 Answers

I had this issue in Webstorm , I Restarted it and it went away

like image 138
nick Avatar answered Sep 20 '22 21:09

nick