【发布时间】:2020-06-04 04:52:17
【问题描述】:
我尝试在 react typescript 项目中使用 JSDocs,但对于具有接口的文件出现此错误
错误:无法解析 C:******* /file.ts:此实验性语法 需要启用以下解析器插件之一:'flow, 打字稿' (1:7
谢谢
【问题讨论】:
标签: typescript jsdoc
我尝试在 react typescript 项目中使用 JSDocs,但对于具有接口的文件出现此错误
错误:无法解析 C:******* /file.ts:此实验性语法 需要启用以下解析器插件之一:'flow, 打字稿' (1:7
谢谢
【问题讨论】:
标签: typescript jsdoc
经过一些研究发现这个项目 cal better-docs 它适用于 jsdocs 并在 jsdoc.conf.json 上添加依赖项和以下配置可解决问题并允许使用 typescript 来解决问题(直到现在)
{
"tags": {
"allowUnknownTags": true,
"dictionaries": ["jsdoc","closure"]
},
"source": {
"include": ["src"],
"includePattern": "\\.(jsx|js|ts|tsx)$",
"excludePattern": "(^|\\/|\\\\)_"
},
"plugins": [
"node_modules/better-docs/typescript"
],
"typescript": {
"moduleRoot": "test"
},
"templates": {
"better-docs": {
"name": "My React components"
}
},
"opts": {
"template": "node_modules/better-docs",
"destination": "docs",
"recurse": true,
"readme": "README.md"
}
}
【讨论】: