错误:由于意外的token =,无法解析JSDoc静态类变量

时间:2017-06-09 06:30:55

标签: node.js static babel jsdoc

您好我的JSDoc无法接受我的部分代码。代码使用webpack编译好,但jsdoc给了我一个错误。

ERROR: Unable to parse <path>\Command.js: Unexpected token =

JSDoc抱怨的代码

/**
 * Base command.
 * @class
 * @abstract
 * @memberOf editor
 */
class Command {

  // This is what jsdoc complains about.
  /**
   * @type {number}
   * @private
   * @static
   */
  static _id = -1;

  constructor(){
    /* ... */
  }
  /* ... */
}

JSDOc conf

{
  "tags": {
    "allowUnknownTags": true,
    "dictionaries": ["jsdoc","closure"]
  },
  "source": {
    "includePattern": ".+\\.js(doc|x)?$",
    "excludePattern": "(dist|node_modules|web_modules|webpack.config|docs)"
  },
  "plugins": ["node_modules/jsdoc-babel"],
  "babel": {
    "extensions": ["jsx", "es6"],
    "presets": ["env", "es2015", "stage-0","react"],
    "plugins": [
      "transform-object-rest-spread"
    ]
  },
  "templates": {
    "cleverLinks": false,
    "monospaceLinks": false
  }
}

非常感谢任何帮助。

0 个答案:

没有答案