我有一个接口/超类/子类结构,该子类实际上仅存在于定义特定类型并提供一些附加的编译时类型检查。在typescript中,jsdoc注释将合并在一起-因此,如果注释是在父对象(例如接口)上定义的,则它将自动向下流过实现类。
这在带有intellisense的Visual Studio Code中很好用-正确检测了界面上的文档注释。到目前为止,completed-docs
规则还不错。
但是,我最近将项目升级到了Angular 8,同时还升级了Typescript和tslint规则等。现在,该规则正在抱怨在超类而不是子类中定义文档的每个地方。除了禁用规则,是否可以配置/禁用此行为?
示例:
export interface MyInterface {
/** This is an example documentation comment. */
myProperty: string;
}
export class MyClass implements MyInterface {
myProperty: MyStringEnumType; // this should not need a documentation comment
// but completed-docs rule is failing it anyway. why?
}
enum MyStringEnumType {
value1 = 'value1'
}
当前规则配置:
/* JSDoc comments required */
"completed-docs": [
true,
{
"enums": true,
"functions": {"visibilities": ["exported"]},
"interfaces": true,
"methods": {"locations": "all", "privacies": ["protected", "public"]},
"properties": {
"privacies": ["public", "protected"], "tags": {"content": {"see": ["#.*"]}, "existence": ["inheritdoc"]}
}
}
],