oxc-project/oxc · error · OxcDiagnostic

Prop '{name}' is not in {case_type}.

Error message

Prop '{name}' is not in {case_type}.

What it means

Emitted by report_if_invalid in the vue prop-name-casing rule when a component prop name does not match the configured casing (camelCase or kebab-case per options and vue_casing check). It is a naming-convention guard over prop definitions in both options objects and defineProps type signatures.

Source

Thrown at crates/oxc_linter/src/rules/vue/prop_name_casing.rs:28

    },
};
use oxc_diagnostics::OxcDiagnostic;
use oxc_macros::declare_oxc_lint;
use oxc_span::{GetSpan, Span};

use crate::{
    AstNode,
    context::LintContext,
    frameworks::FrameworkOptions,
    rule::{Rule, TupleRuleConfig},
    utils::{
        deserialize_regex_vec, find_property, for_each_define_props_type_signature,
        is_vue_component_options_object_excluding_instance, vue_casing,
    },
};

fn prop_name_casing_diagnostic(span: Span, name: &str, case_type: &str) -> OxcDiagnostic {
    OxcDiagnostic::warn(format!("Prop '{name}' is not in {case_type}.")).with_label(span)
}

#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
enum CaseType {
    #[default]
    #[serde(rename = "camelCase")]
    CamelCase,
    #[serde(rename = "snake_case")]
    SnakeCase,
}

impl CaseType {
    fn as_str(self) -> &'static str {
        match self {
            CaseType::CamelCase => "camelCase",
            CaseType::SnakeCase => "snake_case",
        }
    }

View on GitHub (pinned to e1e7af627c)

Solutions

  1. Rename the prop to the configured casing convention
  2. Update the rule's casing option if the project uses a different convention
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/oxc_linter/src/rules/vue/prop_name_casing.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/88224d690dbdc758. Report an issue: GitHub.