Skip to content
← Back to rules

jsdoc/require-param-description Pedantic

🚧 An auto-fix is planned for this rule, but not implemented at this time.

What it does

Requires that each @param tag has a description value.

Why is this bad?

The description of a param should be documented.

Examples

Examples of incorrect code for this rule:

javascript
/** @param foo */
function quux(foo) {}

Examples of correct code for this rule:

javascript
/** @param foo Foo. */
function quux(foo) {}

Configuration

This rule accepts a configuration object with the following properties:

defaultDestructuredRootDescription

type: string

default: "The root object"

The description string to set by default for destructured roots. Defaults to "The root object".

setDefaultDestructuredRootDescription

type: boolean

default: false

Whether to set a default destructured root description. For example, you may wish to avoid manually having to set the description for a @param corresponding to a destructured root object as it should always be the same type of object. Uses defaultDestructuredRootDescription for the description string. Defaults to false.

How to use

To enable this rule using the config file or in the CLI, you can use:

json
{
  "plugins": ["jsdoc"],
  "rules": {
    "jsdoc/require-param-description": "error"
  }
}
ts
import { defineConfig } from "oxlint";

export default defineConfig({
  plugins: ["jsdoc"],
  rules: {
    "jsdoc/require-param-description": "error",
  },
});
bash
oxlint --deny jsdoc/require-param-description --jsdoc-plugin

Version

This rule was added in v0.4.4.

References