-
-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jsdoc/require-jsdoc: False positive when documentation is inherited from interface #768
Comments
ESLint is not aware of the whole program, so if we were to support this, it would probably only check the current file. However, this is not something I'm really inclined to spend time on. PR would be fine. |
Our current eslint setup was enforcing all `public` methods in _classes_ to have a jsdoc, but not interfaces. As a result, most of our interfaces (where we want to have docs the most) were undocumented, and the classes that implement them carried the documentation instead. This PR changes the eslint config so we enforce all interface methods to have documentation. All classes that implement them automatically inherit their docs (in vscode intellisense and in typedoc), so we don't need to repeat the docs there and can clean those up. Unfortunately, `require-jsdoc` cannot detect this automatically (see gajus/eslint-plugin-jsdoc#768), so we tweak the config so that jsdoc is not required for methods of classes that implement an interface (not perfect, but good enough). This new esquery filter required bumping the version of tslint. Another issue with our config is that methods that are public by default (ie without an accessibility modifier) do not have jsdoc enforced. I tried enabling that but got 148 missing docs - so I'll leave that out for now, and is commented in the eslintrc file.
My workaround is usually to add a
It works well with The only downside is that it does not play well with |
Expected behavior
Method without documentation should pass when there is a documentation for it in an interface located in "implements" section.
I have checked that this situation is correctly handled by typedoc (https://www.npmjs.com/package/typedoc) and vscode editor.
Both extract documentation from interface.
See that vscode undestands this situation:
Actual behavior
The rule shows error in the situation described above.
ESLint Config
ESLint sample
Environment
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: