{"record":{"id":"681914f0b8f879ce","repo":"oxc-project/oxc","slug":"name-name-is-reserved-in-vue-js","errorCode":null,"errorMessage":"Name \"{name}\" is reserved in Vue.js.","messagePattern":"Name \"(.+?)\" is reserved in Vue\\.js\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"warning","filePath":"crates/oxc_linter/src/rules/vue/no_reserved_component_names.rs","lineNumber":33,"sourceCode":"    rule::{DefaultRuleConfig, Rule},\n    utils::{\n        VUE_RESERVED_DEPRECATED_HTML_ELEMENTS, VUE_RESERVED_HTML_ELEMENTS,\n        VUE_RESERVED_KEBAB_CASE_ELEMENTS, VUE_RESERVED_SVG_ELEMENTS, VUE2_BUILTIN_COMPONENT_NAMES,\n        VUE3_BUILTIN_COMPONENT_NAMES_EXTRA, find_property,\n        is_vue_component_options_object_excluding_instance,\n    },\n};\n\nfn reserved_diagnostic(name: &str, span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\"Name \\\"{name}\\\" is reserved.\")).with_label(span)\n}\n\nfn reserved_in_html_diagnostic(name: &str, span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\"Name \\\"{name}\\\" is reserved in HTML.\")).with_label(span)\n}\n\nfn reserved_in_vue_diagnostic(name: &str, span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\"Name \\\"{name}\\\" is reserved in Vue.js.\")).with_label(span)\n}\n\nfn reserved_in_vue3_diagnostic(name: &str, span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\"Name \\\"{name}\\\" is reserved in Vue.js 3.x.\")).with_label(span)\n}\n\n#[derive(Debug, Default, Clone, JsonSchema, Deserialize)]\n#[serde(rename_all = \"camelCase\", default, deny_unknown_fields)]\npub struct NoReservedComponentNames {\n    /// Disallow Vue 2 built-in component names (e.g. `Transition`, `KeepAlive`).\n    disallow_vue_built_in_components: bool,\n    /// Disallow Vue 3 built-in component names (e.g. `Teleport`, `Suspense`).\n    /// Note: this also catches Vue 2 built-ins because Vue 3's set includes them.\n    disallow_vue3_built_in_components: bool,\n    /// Match HTML / SVG element names case-sensitively. When `false` (default),\n    /// the capitalized form of an HTML element (e.g. `Div`) is also reported.\n    html_element_case_sensitive: bool,\n}","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/vue/no_reserved_component_names.rs#L15-L51","documentation":"The Vue-2 built-ins variant of vue/no-reserved-component-names: 'Name \"{name}\" is reserved in Vue.js.' It fires for Vue 2 built-in component names (VUE2_BUILTIN_COMPONENT_NAMES, e.g. `Transition`, `KeepAlive`, and friends) when the `disallowVueBuiltInComponents` option is enabled. Using these names shadows Vue's own global components, so resolution depends on registration order and easily breaks.","triggerScenarios":"Enabling the rule's `disallowVueBuiltInComponents` option and naming a component `Transition`, `KeepAlive`, or another Vue 2 built-in from the util list.","commonSituations":"Design systems that ship their own `Transition` wrapper; migrating a Vue 2 app where a local component was named after a built-in; enabling the stricter option during a lint-config upgrade and surfacing old names.","solutions":["Rename the component (e.g. `FadeTransition`, `AppKeepAlive`).","If you meant to wrap the built-in, keep the built-in name in the template and rename only your wrapper component.","If the collision is intentional and versioned, document it — but renaming is the durable fix.","Re-run oxlint with the option still enabled to confirm."],"exampleFix":"// before\nexport default {\n  name: 'Transition' // reserved in Vue.js\n}\n\n// after\nexport default {\n  name: 'FadeTransition'\n}","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enable `disallowVueBuiltInComponents` in shared lint configs so collisions surface early.","Never name your own components Transition, KeepAlive, or other Vue 2 built-ins.","During Vue 2 -> 3 migrations, sweep for built-in-named components proactively."],"tags":["vue","naming","lint","vue2","reserved-names","components"],"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"}