oxc-project/oxc · error · OxcDiagnostic

Missing JSDoc `@param` type.

Error message

Missing JSDoc `@param` type.

What it means

Fires from jsdoc/require-param-type when a @param tag names the parameter but omits its type annotation (the '{type}' braces). The helper labels the tag span; the help mentions adding {type} per the rule's typing expectations.

Source

Thrown at crates/oxc_linter/src/rules/jsdoc/require_param_type.rs:21

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

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

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

fn missing_root_type_diagnostic(span: Span, default_type: &CompactStr) -> OxcDiagnostic {
    OxcDiagnostic::warn("Missing root type for @param.")
        .with_help(format!("Add {{{default_type}}} to `@param` tag."))
        .with_label(span)
}

#[derive(Debug, Clone, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase", default, deny_unknown_fields)]
pub struct RequireParamTypeConfig {
    /// The type string to set by default for destructured roots. Defaults to "object".
    default_destructured_root_type: CompactStr,
    /// Whether to set a default destructured root type. For example, you may wish to avoid manually having to set the type for a `@param` corresponding to a destructured root object as it is always going to be an object. Uses `defaultDestructuredRootType` for the type string. Defaults to `false`.
    set_default_destructured_root_type: bool,
}

View on GitHub (pinned to e1e7af627c)

Solutions

  1. Add a type in braces, e.g. `@param {string} name - ...`
  2. Use `{*}` if the type is genuinely unknown
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/oxc_linter/src/rules/jsdoc/require_param_type.rs:21 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/a746692a04eed5d4. Report an issue: GitHub.