oxc-project/oxc · error · OxcDiagnostic

Missing JSDoc `@param` name.

Error message

Missing JSDoc `@param` name.

What it means

This diagnostic is raised by the jsdoc/require_param_name rule when a JSDoc comment contains a `@param` tag whose description or type is present but the parameter name is absent (e.g. `@param {string} - desc`). At the throw site it means the JSDoc block attached to the nearest function documents a parameter without identifying it, so the documentation cannot be matched to an actual function argument. It fires from run() for every `@param` tag parsed from the function's JSDoc node whose name part is empty, unless the symbol is ignored as internal or private.

Source

Thrown at crates/oxc_linter/src/rules/jsdoc/require_param_name.rs:14

use oxc_ast::AstKind;
use oxc_diagnostics::OxcDiagnostic;
use oxc_macros::declare_oxc_lint;
use oxc_span::Span;

use crate::{
    AstNode,
    context::LintContext,
    rule::Rule,
    utils::{get_function_nearest_jsdoc_node, should_ignore_as_internal, should_ignore_as_private},
};

fn missing_name_diagnostic(span: Span) -> OxcDiagnostic {
    OxcDiagnostic::warn("Missing JSDoc `@param` name.")
        .with_help("Add name to `@param` tag.")
        .with_label(span)
}

#[derive(Debug, Default, Clone)]
pub struct RequireParamName;

declare_oxc_lint!(
    /// ### What it does
    ///
    /// Requires that all `@param` tags have names.
    ///
    /// ### Why is this bad?
    ///
    /// The name of a param should be documented.
    ///
    /// ### Examples
    ///

View on GitHub (pinned to e1e7af627c)

Solutions

  1. Add the parameter name after the `@param {type}` portion
  2. Remove the stray `@param` tag if the parameter no longer exists
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/oxc_linter/src/rules/jsdoc/require_param_name.rs:14 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/6cdc983aadf5a9e2. Report an issue: GitHub.