{"record":{"id":"df0b47fec07879fd","repo":"oxc-project/oxc","slug":"name-name-is-reserved","errorCode":null,"errorMessage":"Name \"{name}\" is reserved.","messagePattern":"Name \"(.+?)\" is reserved\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"warning","filePath":"crates/oxc_linter/src/rules/vue/no_reserved_component_names.rs","lineNumber":25,"sourceCode":"};\nuse oxc_diagnostics::OxcDiagnostic;\nuse oxc_macros::declare_oxc_lint;\nuse oxc_span::{GetSpan, Span};\n\nuse crate::{\n    AstNode,\n    context::LintContext,\n    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`).","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/vue/no_reserved_component_names.rs#L7-L43","documentation":"The base diagnostic of vue/no-reserved-component-names: 'Name \"{name}\" is reserved.' Naming a component after a reserved token (e.g. kebab-case reserved custom-element names or deprecated HTML elements from the rule's util lists VUE_RESERVED_KEBAB_CASE_ELEMENTS / VUE_RESERVED_DEPRECATED_HTML_ELEMENTS) makes Vue unable to resolve it reliably in templates, because the name collides with platform or reserved vocabulary. The rule reads the component's `name` option (and file/name registrations) in objects recognized as component definitions.","triggerScenarios":"Registering or declaring a component whose name equals an entry from the reserved kebab-case / deprecated HTML element lists, e.g. `export default { name: 'custom-links' }` or a component named after a deprecated element.","commonSituations":"Naming utility components after custom-element-style tags; porting HTML snippets into components and keeping the tag name; shared component libraries that were never checked against the reserved lists.","solutions":["Rename the component to something outside the reserved kebab-case/deprecated lists.","If the name is only used for recursion or devtools, a prefixed unique name (e.g. 'AppCustomLinks') works without behavior change.","If you intentionally declare a custom element, use Vue's `is`/custom-element registration path instead of a component name collision.","Re-run oxlint to verify."],"exampleFix":"// before\nexport default {\n  name: 'custom-links', // reserved\n  // ...\n}\n\n// after\nexport default {\n  name: 'AppCustomLinks',\n  // ...\n}","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pick component names that are not custom-element-like kebab tags or deprecated element names.","Prefix shared-library component names (App*, Ui*) to stay clear of reserved vocabulary.","Run oxlint with the Vue preset when naming new components."],"tags":["vue","naming","lint","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"}