【发布时间】:2017-06-12 16:06:47
【问题描述】:
我使用 webstorm v 10.0.4。我想在 webstorm 中使用 JSDoc 来验证使用的对象属性是否有错误。我希望以下示例显示警告但没有任何反应。
在设置面板,Editor->Inspections,Javascript->General,被“jsdoc”过滤后出现3个参数:
JsDoc 注释匹配函数签名
可能无效的构造函数用法
验证 JsDoc /ASDoc
选择其中的 3 个以显示警告
这是我的示例,没有显示任何警告:
/**
*
* @typedef {Object} cleanJRef
*
* @property {string} rRefName
* @property {string} rActiveId
* @property {string} rActiveName
* @property {string} rDbId
* @property {string} rDbName
* @property {Object} rActiveElt
*/
//TODO: why this test do not show a warning or error in webstorm?
/** @type {cleanJRef} */
var testCleanJRef = {
rRefName: 1, //should have a warning here
rActiveId: "0",
rActiveName: "Name",
rDbId: "0",
rDbName: "nom",
rActiveElt: "new Object()", //should have a warning here
incorrectProp: "false" //should have a warning here
};
【问题讨论】: