Typedoc Error: Tried to set an option (mode) that was not declared

Typedoc Error: Tried to set an option (mode) that was not declared

我安装了类型文档:

npm install typedoc --save-dev

然后将 typedocOptions 添加到 tsconfig.json:

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    // ...some lines there
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ],
    "emitDecoratorMetadata": true
  },
  "angularCompilerOptions": {
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true
  },
  "typedocOptions": {
    "mode": "modules",
    "out": "docs"
  }
}

然后我做:

npx typedoc --out docs src/index.ts

并得到错误:

Error: Tried to set an option (mode) that was not declared.

如何解决?

mode 选项已从 v0.20.0 开始删除,如 release notes 中所述。 完整的选项列表可以在 documentation.

中看到

相关问题here