oxc-project/oxc · error

This is not a valid ARIA state and property value for

Error message

This is not a valid ARIA state and property value for '{prop_name}'.

What it means

Fires from jsx-a11y/aria-proptypes when an ARIA attribute's value does not match the type required by the ARIA spec for that property (e.g. a non-boolean given to aria-hidden, or an out-of-range integer for aria-level). The helper interpolates the property name and builds help text listing the valid values for the detected type.

Solutions

  1. Set the attribute to a valid value for its ARIA property type (per the help text listing valid values)
  2. Use the correct value kind: boolean, integer, ID reference, token, or string as required
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/oxc_linter/src/rules/jsx_a11y/aria_proptypes.rs:28 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/507025518a9efbe0. Report an issue: GitHub.

Appendix: source

Thrown at crates/oxc_linter/src/rules/jsx_a11y/aria_proptypes.rs:28

use oxc_span::Span;
use oxc_str::CompactStr;
use oxc_syntax::operator::UnaryOperator;

use crate::{
    AstNode,
    context::LintContext,
    globals::AriaProperty,
    rule::Rule,
    utils::{get_jsx_attribute_name, starts_with_ignore_case},
};

fn aria_proptypes_diagnostic(
    span: Span,
    prop_name: &str,
    prop_type: &AriaPropType,
) -> OxcDiagnostic {
    let valid_prop_message = generate_valid_prop_message(prop_type);
    OxcDiagnostic::warn(format!("This is not a valid ARIA state and property value for '{prop_name}'."))
    .with_help(format!(
        "The valid value for '{prop_name}' is: {valid_prop_message}.\nYou can find a list of valid ARIA state and property values at https://www.w3.org/TR/wai-aria/#x6-7-definitions-of-states-and-properties-all-aria-attributes"
    ))
    .with_label(span)
}

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

declare_oxc_lint!(
    /// ### What it does
    ///
    /// Enforces that elements do not use invalid ARIA state and property values.
    ///
    /// ### Why is this bad?
    ///
    /// Using invalid ARIA state and property values can mislead screen readers and other assistive technologies.
    /// It may cause the accessibility features of the website to fail, making it difficult for users with disabilities to use the site effectively.

View on GitHub (pinned to e1e7af627c)