Skip to main content

Require JSDoc Param Name

Require @param descriptions to match the parameter name, capitalized with a trailing period.

Summary

The require-jsdoc-param-name rule reports any @param tag whose description does not match the expected format derived from the parameter name.

The expected description is the parameter name split on camelCase boundaries, with the first letter capitalized and all other letters lowercased, followed by a trailing period. For example, defaultOptions becomes Default options..

Why Use This Rule?

  1. Ensures @param descriptions are consistent and predictable across the codebase.
  2. Eliminates freeform descriptions that may drift out of sync with the actual parameter name.
  3. Makes JSDoc blocks scannable because every description follows the same mechanical pattern.

Examples

Configuration

Options

warning

ignoreFiles is an escape hatch for files where this rule genuinely does not apply. It is not intended for routine use.

OptionTypeDefaultDescription
ignoreFilesstring[][]File patterns to skip.

Autofix

This rule provides automatic fixes. Run ESLint with the --fix flag:

npx eslint --fix . --rule '@cbnventures/nova/require-jsdoc-param-name: error'

Troubleshooting

  • Warning fires with the wrong expected text — The rule splits camelCase names on uppercase boundaries. Single-word parameters like context become Context.. Multi-word parameters like defaultOptions become Default options..
  • Param tags without a dash separator are skipped — The rule only matches @param tags that follow the format @param {Type} name - Description. Tags without the - separator are not checked.