Skip to content

VIEW002: duplicate-component-name

Sibling components share a name

Code VIEW002
Name duplicate-component-name
Category View structure (VIEW)
Default severity error
Enabled by default yes
Fix available no
ign-lint equivalent none

Reports a component whose meta.name equals the name of an earlier sibling (a component with the same parent).

Perspective addresses components by name: getChild('Label'), getSibling('Label'), {../Label.props.text} and /root/Panel/Label all resolve to the first sibling with that name, so the second component can never be reached and bindings silently read the wrong one. The Designer normally prevents duplicates; they appear after hand edits, merges or copy-paste between views.

"children": [
{"type": "ia.display.label", "meta": {"name": "Label"}},
{"type": "ia.display.label", "meta": {"name": "Label"}}
]

Use instead:

"children": [
{"type": "ia.display.label", "meta": {"name": "Title"}},
{"type": "ia.display.label", "meta": {"name": "Subtitle"}}
]

Generated from the rule metadata by iglint generate-docs; iglint rule VIEW002 prints the same page in the terminal. Source: docs/rules/VIEW002.md.