【发布时间】:2021-05-31 12:27:38
【问题描述】:
我正在测试一些不同的文档引擎,我想为我们的大型项目尝试 typedoc。我们在整个项目中都有各种测试文件(somefile.test.ts 或 someotherfile.test.tsx)。我正在努力让 typedoc 忽略这些文件。我做了npm i -D typedoc,然后在我的 tsconfig.json 中
{
"compilerOptions": {
"configOptions": "some_options"
},
"include": ["src"],
"typedocOptions": {
"out": "docs",
"entryPoints": "src/index.tsx",
"exclude": [
"**/*.test.ts*",
"**/*.test.tsx*"
]
}
}
然后我运行我的 npm 命令"tsdoc": "typedoc" - npm run tsdoc。 Typedoc 遍历我的文件并在我的测试文件中发现大量的打字稿 linting 错误,因此它无法运行。 (我们最近更新了我们的@types/jest,所以 eslint 和 ts 抱怨诸如 Property 'toEqual' does not exist on type 'Assertion' 和 Property 'toMatchSnapshot' does not exist on type 'Assertion' 之类的事情。eslint 和 ts 抱怨这些事情,但它不会阻止测试运行。但是有什么问题我的typedocOptions 没有正确忽略这些文件?
【问题讨论】:
标签: typescript jsdoc documentation-generation typedoc tsdoc