gajus / eslint-plugin-jsdoc

JSDoc specific linting rules for ESLint.
Other
1.07k stars 155 forks source link

Missing docs for informative-docs > excludedTags option #1214

Closed JoshuaKGoldberg closed 3 months ago

JoshuaKGoldberg commented 4 months ago

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 commented 4 months ago

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

JoshuaKGoldberg commented 4 months ago

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

github-actions[bot] commented 3 months ago

:tada: This issue has been resolved in version 48.2.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: