{"record":{"id":"6c78cd7c5eecc848","repo":"oxc-project/oxc","slug":"key-key-is-reserved-in-group-group","errorCode":null,"errorMessage":"Key `{key}` is reserved in `{group}` group.","messagePattern":"Key `(.+?)` is reserved in `(.+?)` group\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"warning","filePath":"crates/oxc_linter/src/rules/vue/no_reserved_keys.rs","lineNumber":57,"sourceCode":"    \"$watch\",\n    \"$set\",\n    \"$delete\",\n    \"$on\",\n    \"$once\",\n    \"$off\",\n    \"$emit\",\n    \"$mount\",\n    \"$forceUpdate\",\n    \"$nextTick\",\n    \"$destroy\",\n];\n\nfn reserved_key_diagnostic(name: &str, span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\"Key `{name}` is reserved.\")).with_label(span)\n}\n\nfn starts_with_underscore_diagnostic(key: &str, group: &str, span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\"Key `{key}` is reserved in `{group}` group.\")).with_label(span)\n}\n\n#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema)]\n#[serde(rename_all = \"camelCase\", default, deny_unknown_fields)]\nstruct NoReservedKeysConfig {\n    /// Extra reserved key names to disallow, on top of the built-in list.\n    reserved: Vec<CompactStr>,\n    /// Extra component option groups to inspect, on top of the built-in\n    /// `props` / `computed` / `data` / `asyncData` / `methods` / `setup`.\n    groups: Vec<CompactStr>,\n}\n\n#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema)]\npub struct NoReservedKeys(Box<NoReservedKeysConfig>);\n\ndeclare_oxc_lint!(\n    /// ### What it does\n    ///","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/vue/no_reserved_keys.rs#L39-L75","documentation":"The underscore variant of vue/no-reserved-keys: 'Key `{key}` is reserved in `{group}` group.' Vue treats `_`-prefixed properties as internal (not proxied on the instance), so a key starting with `_` declared in a group such as `props`, `data`, `computed`, `methods` or `setup` will not be reachable as `this.key` / in the template. The message names the offending group so you know exactly where the key lives.","triggerScenarios":"Declaring an `_`-prefixed key in any built-in group (`props` / `computed` / `data` / `asyncData` / `methods` / `setup`) or a group listed in the rule's `groups` config, e.g. `data() { return { _internalFlag: true } }`.","commonSituations":"Marking 'private' state with a `_` prefix (a common convention from other languages); library components exposing `_`-prefixed props; Nuxt `asyncData` returning underscore keys that are then unreachable in the template.","solutions":["Rename the key to remove the leading underscore.","If the state really is private, keep it outside the proxied groups (module-scope variable or non-reactive closure state) rather than using a `_` name inside them.","Check the rule's `groups` config if the report names a custom group you added.","Re-run oxlint to confirm."],"exampleFix":"// before\nexport default {\n  data() {\n    return { _cache: {} } // reserved in `data` group\n  }\n}\n\n// after\nconst cache = {}; // module-scope, intentionally private\nexport default {\n  data() {\n    return { visibleCount: 0 }\n  }\n}","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not mark 'private' state with a `_` prefix inside props/data/computed/methods/setup — Vue will not proxy it.","Keep truly private state at module scope or outside reactive groups.","Lint Nuxt components' asyncData returns for underscore keys."],"tags":["vue","naming","lint","reserved-keys","options-api"],"backgroundTag":"reserved-name-collision","analyzedSha":"e1e7af627c8843ab64044ed466b128fcc21a035b","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}