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?
- Ensures
@paramdescriptions are consistent and predictable across the codebase. - Eliminates freeform descriptions that may drift out of sync with the actual parameter name.
- 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.
| Option | Type | Default | Description |
|---|---|---|---|
ignoreFiles | string[] | [] | 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
contextbecomeContext.. Multi-word parameters likedefaultOptionsbecomeDefault options.. - Param tags without a dash separator are skipped — The rule only matches
@paramtags that follow the format@param {Type} name - Description. Tags without the-separator are not checked.