oxc-project/oxc · error · OxcDiagnostic

Unknown property found

Error message

Unknown property found

What it means

Raised by react/no_unknown_property when a JSX attribute is not a known React DOM property/attribute and no data-/aria- exemption applies, but it closely matches a standard name (e.g. `class` instead of `className`, `for` instead of `htmlFor`). At the throw site the prop is invalid as written — React ignores unknown DOM props — and the rule's typo detection has identified the standard name the author almost certainly meant. unknown_prop_with_standard_name fires from run() when the attribute name normalizes to a known property.

Source

Thrown at crates/oxc_linter/src/rules/react/no_unknown_property.rs:40

    utils::get_jsx_attribute_name,
};

fn invalid_prop_on_tag(span: Span, prop: &str, tag: &str) -> OxcDiagnostic {
    OxcDiagnostic::warn("Invalid property found")
        .with_help(format!("Property '{prop}' is only allowed on: {tag}"))
        .with_label(span)
}

fn data_lowercase_required(span: Span, suggested_prop: &str) -> OxcDiagnostic {
    OxcDiagnostic::warn(
        "React does not recognize data-* props with uppercase characters on a DOM element",
    )
    .with_help(format!("Use '{suggested_prop}' instead"))
    .with_label(span)
}

fn unknown_prop_with_standard_name(span: Span, x1: &str) -> OxcDiagnostic {
    OxcDiagnostic::warn("Unknown property found")
        .with_help(format!("Use '{x1}' instead"))
        .with_label(span)
}

fn unknown_prop(span: Span) -> OxcDiagnostic {
    OxcDiagnostic::warn("Unknown property found")
        .with_help("Remove unknown property")
        .with_label(span)
}

#[derive(Debug, Default, Clone, Deserialize)]
pub struct NoUnknownProperty(Box<NoUnknownPropertyConfig>);

#[derive(Default, Debug, Clone, PartialEq, Eq, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase", default, deny_unknown_fields)]
pub struct NoUnknownPropertyConfig {
    /// List of properties to ignore.
    ignore: FxHashSet<Cow<'static, str>>,

View on GitHub (pinned to e1e7af627c)

Solutions

  1. Replace the unknown property with the suggested standard name.
  2. For custom attributes, use a data-* name or register it in the rule's ignore list.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/oxc_linter/src/rules/react/no_unknown_property.rs:40 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/66f016e090cb6133. Report an issue: GitHub.