如何在使用webstorm的模块中需要时为npm config编写JSDocs?

时间:2015-03-05 16:01:44

标签: javascript annotations comments webstorm jsdoc

配置/ 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?

不重复

0 个答案:

没有答案