配置/ default.json
{
"somevar": "sometext"
}
SomeModule.js
/**
* From the configuration file
* @typedef {Object} config
* @property {string} somevar
*/
var config = require('config');
var someObject = {
somevar: config.somevar // Webstorm doesn't know what this is!
};
Webstorm在config的somevar属性下放置了一条颠簸的行。我怎么能不这样做,并用jsdocs实际识别它?
编辑:此问题与How to annotate core Node.js modules with JSDoc to have code hinting in IntelliJ?
不重复