Skip to content
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

Missing docs for informative-docs > excludedTags option #1214

Closed
JoshuaKGoldberg opened this issue Mar 9, 2024 · 3 comments · Fixed by #1216
Closed

Missing docs for informative-docs > excludedTags option #1214

JoshuaKGoldberg opened this issue Mar 9, 2024 · 3 comments · Fixed by #1216

Comments

@JoshuaKGoldberg
Copy link
Contributor

Motivation

jsdoc/informative-docs will scan the body and all tags of a JSDoc tag for informative-ness. This is good and intended in most cases. But sometimes, there are tags that are used as categorization / metadata and only coincidentally match the name of the construct they're documenting. For example:

/**
 * Calculates and retrieves the compiler options for the current project.
 * @category Compiler Options
 */
function getCompilerOptions() {
  // ...
}

Standalone reproduction of that snippet for reference: https://github.com/JoshuaKGoldberg/repros/tree/jsdoc-informative-docs-category-tag

Current behavior

  3:1  error  This tag description only repeats the name it describes  jsdoc/informative-docs

Desired behavior

Can we add an option to the rule to allow a list of tags to be ignored? Say, ignoredTags?

"jsdoc/informative-docs": ["error", {
  "ignoredTags": ["category"]
}]

Alternatives considered

An inline disable comment is doable, but clutters the code and is generally inconvenient.

@brettz9
Copy link
Collaborator

brettz9 commented Mar 9, 2024

There is already an excludedTags array option... It just isn't currently documented.

@JoshuaKGoldberg
Copy link
Contributor Author

Aha! #1153 - that must be why it didn't come up in my searches. Nice. Thanks - will send a docs PR.

@JoshuaKGoldberg JoshuaKGoldberg changed the title Allow excluding individual tags from informative-docs Missing docs for informative-docs > excludedTags option Mar 9, 2024
Copy link

🎉 This issue has been resolved in version 48.2.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants