oxc-project/oxc · error · OxcDiagnostic

Missing JSDoc `@param` declaration for function parameters.

Error message

Missing JSDoc `@param` declaration for function parameters.

What it means

Fires from jsdoc/require-param when a documented function has parameters in its signature that are not covered by any @param tag. The rule collects each undocumented parameter's span and passes all violations to this diagnostic, which labels every offending parameter position.

Source

Thrown at crates/oxc_linter/src/rules/jsdoc/require_param.rs:25

use oxc_ast::{
    AstKind,
    ast::{FormalParameters, MethodDefinitionKind, TSType},
};
use oxc_diagnostics::OxcDiagnostic;
use oxc_macros::declare_oxc_lint;
use oxc_semantic::{AstNode, JSDoc, NodeId};

use crate::{
    context::LintContext,
    rule::Rule,
    utils::{
        ParamKind, collect_params, deserialize_regex, get_function_nearest_jsdoc_node,
        should_ignore_as_avoid, should_ignore_as_internal, should_ignore_as_private,
    },
};

fn require_param_diagnostic(violations: Vec<Span>) -> OxcDiagnostic {
    OxcDiagnostic::warn("Missing JSDoc `@param` declaration for function parameters.")
        .with_help("Add `@param` tag with name.")
        .with_labels(violations)
}

#[derive(Debug, Default, Clone)]
pub struct RequireParam(Box<RequireParamConfig>);

#[derive(Debug, Clone, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase", default, deny_unknown_fields)]
struct RequireParamConfig {
    /// List of JSDoc tags that exempt functions from `@param` checking.
    #[serde(default = "default_exempted_by")]
    exempted_by: Vec<String>,
    /// Whether to check constructor methods.
    check_constructors: bool,
    /// Whether to check getter methods.
    check_getters: bool,
    /// Whether to check setter methods.

View on GitHub (pinned to e1e7af627c)

Solutions

  1. Add a `@param` tag for each undocumented parameter
  2. Use `@param foo` (name-only) if descriptions are not required by your config
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/oxc_linter/src/rules/jsdoc/require_param.rs:25 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of oxc-project/oxc@e1e7af627c (2026-08-20). Data as JSON: /api/errors/a45ab44eaa1da1de. Report an issue: GitHub.