oxc-project/oxc · error · OxcDiagnostic

No root defined for `@property` path.

Error message

No root defined for `@property` path.

What it means

Fires from jsdoc/check-property-names when a @property path references a parent name (e.g. 'foo.bar' where the path before the dot, or its '[]' stripped form) that has not been declared by any earlier @property in the block. The no_root helper labels the span and names the orphan path in the help text.

Source

Thrown at crates/oxc_linter/src/rules/jsdoc/check_property_names.rs:13

use oxc_diagnostics::{LabeledSpan, OxcDiagnostic};
use oxc_macros::declare_oxc_lint;
use oxc_span::Span;
use rustc_hash::{FxHashMap, FxHashSet};

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

fn no_root(span: Span, x1: &str) -> OxcDiagnostic {
    OxcDiagnostic::warn("No root defined for `@property` path.")
        .with_help(format!("`@property` path declaration `{x1}` appears before any real property."))
        .with_label(span)
}

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

declare_oxc_lint!(
    /// ### What it does
    ///
    /// Ensures that property names in JSDoc are not duplicated on the same block and that nested properties have defined roots.
    ///
    /// ### Why is this bad?
    ///
    /// `@property` tags with the same name can be confusing and may indicate a mistake.
    ///
    /// ### Examples
    ///

View on GitHub (pinned to e1e7af627c)

Solutions

  1. Declare the root property with its own @property tag before nested paths
  2. Fix the parent name in the path so it matches a declared property
Defensive patterns

Strategy: validation

When it happens

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