-
-
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
require specific tags #936
Comments
See If you are using a custom tag, the rule We don't have rules to specifically enforce inline tags like 'jsdoc/no-missing-syntax': ['error', {
{
comment: 'JsdocBlock:has(JsdocTag[tag="see"])',
context: 'any',
message: '@see required on each block',
}
}] ...and you should also be able to use Closing as this should resolve the issue, though feel free to report further issues if you run into trouble. |
Hi @brettz9, I've tried your code snippet:
but it doesn't work for me. However, you gave a different code snippet in another issue: #876
Why does the second work, but the first doesn't? And wouldn't it make sense to add this to the docs, since it seems like a common use case? |
Ah ok, yes, the second one is probably what you want. The second one will complain if there are JSDoc blocks which don't have a The first should complain if your document doesn't have at least one JSDoc block with a
Our docs are getting too large as it is, and I'm not sure how common this use case is; it sounds to me like a lot of work, but happy if it works for ya. We do have other similar ones, though, in any case. |
On second thought, I guess we don't have quite this sort of use case in this rule, so I've gone ahead and added it to the docs. Thanks! |
Thanks @brettz9! |
Thank you to both of you. @Narretz you solution works really well. Setting a |
🎉 This issue has been resolved in version 39.6.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Motivation
I'm writing some code and part of this, I would like to enforce a rule/check that would require developers to put a specific (custom) tag in the jsdoc.
The rational is JSdocs are really helpful to improving code quality, but if this plugin could enforce the presence or any tag (custom and existing ones), it would allow developers extend the scope of their documentation greatly.
Maybe a generic
require-tagname
would be the way to go? Like it is done forrequire-property
but with no checks on value.Current behavior
@link
) but I'm struggling find a way to enforce its presence in each jsdoc section across the code base.Desired behavior
@tag
is missing from the JSDoc section.Alternatives considered
Thank you for considering this feature request.
The text was updated successfully, but these errors were encountered: