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
require-jsdoc rule should ignore annotations in TypeScript files #557
Comments
🎉 This issue has been resolved in version 26.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Besides ESLint being independent from TSLint (though thankfully they were on board for TypeScript supporting changes), and despite ESLint recommending this plugin after deprecating (most of) its jsdoc support, However, we have in fact been adding support progressively for TypeScript, so feel free to file such cases of missing support in the future, and perhaps someone may implement. But I mention we are independent as we are not associated with those other projects as part of one official team necessarily committed or obligated to supporting everything TypeScript. In any case though, this issue has been fixed. Thanks for the report! |
@brettz9, thanks for the fix, it will help me a lot! /**
* This will fail because of 'export'.
*/
@Entity()
export class User { } /**
* This will work because there is no export.
*/
@Entity()
class User { } /**
* This is also ok.
*/
export class User { } Could that be added as part of the fix? |
With or without |
Hi @brettz9, I am still having the error. I created this to replicate the error (it takes a few seconds to run, but you can see the console output): https://repl.it/@saulotoledo/eslint-jsdoc-requiredoc-issue Am I doing anything wrong there? |
…class declarations in finding jsdoc block; fixes gajus#557
🎉 This issue has been resolved in version 26.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
No, your example in that repo was indeed not being recognized. (You have arguments within the decorator in that repo example while such an example was not given here, so, with my not being well familiar with TS/decorators, I had not tested that case.) This should now be addressed in v26.0.2. |
Thanks @brettz9, it worked! :D |
Using @saulotoledo's https://repl.it/@saulotoledo/eslint-jsdoc-requiredoc-issue example, I found the fixer ( Could the default behavior place the auto-generated jsdoc above any decorators (including multiline decorators which is actually common in Angular Modules for example)? |
@seanblonien : Sounds reasonable--can you open a new issue though please? |
After TSLint deprecation note, this is the recommended ESLint plugin to be used for documentation. It is also common to use annotations in TypeScript. However, the
require-jsdoc
rule does not accept the following example:Expected behavior
The example below should be accepted as valid.
Actual behavior
ESLint will fail with the error "Missing JSDoc comment" until you move the annotations.
ESLint Config
Environment
eslint-plugin-jsdoc
version: 25.4.2The text was updated successfully, but these errors were encountered: