/**
* Some interface.
*/
interface SomeInterface {
prop: number;
method(): number;
}
with tslint.json configuration:
{
"rules": {
"completed-docs": [
true,
"interfaces",
"methods",
"properties"
]
}
}
No errors.
prop and method should require documentation.
This seemed like it would be a fairly simple fix - the rule wasn't checking PropertySignature or MethodSignature nodes. After adding cases to check those nodes, it started producing errors where the properties and methods didn't have comments, but it _also_ produced errors where the properties and methods _did_ have comments. 馃槙
From what I could tell, symbol.getDocumentationComment() wasn't finding the documentation comments.
This seems like an upstream issue with TypeScript, but maybe this could be solved if #3376 is implemented.
This makes the rule pretty much useless to anyone who embraces functional class-free programming 馃檨
Since #3376 is a bit controversial, is there an upstream issue filed on TypeScript?
Hey @felixfbecker, thanks for bumping this!
I just took another look to see if anything might have changed in TypeScript since I last looked at this.
As it turns out, the changes I originally made to fix this _were_ working correctly, but the code that I was linting in my tests didn't have proper JSDoc comments. 馃槷 So TypeScript was correctly _not_ finding the JSDoc comments, even though I thought it should.
I fixed that test and everything worked. I've just submitted a PR with the changes to fix this bug. 馃榿
Fixed in #4032 and released in 5.12.0