I have a Node project with a Gruntfile.js and package.json in the root directory, and there's code in Gruntfile.js that loads package.json:
var pkg = grunt.file.readJSON("package.json");
and package.json contains a simple object definition:
author: "Jeff Parsons",
but references to that object in Gruntfile.js, like:
result in "unresolved variable" warnings in PhpStorm. Is there some combination of JSDoc tags, for example, I could use to get PhpStorm to recognize all the properties that pkg contains?
Work-arounds I've seen involve doing things like creating dummy variables with all the same properties as the original JSON, but it would be nice to avoid duplicating what's already inside the package.json file. And my problem isn't limited to "standard" package.json object properties -- I've also added custom properties to my JSON files, and having to duplicate those properties in another definition somewhere would be less than ideal.