[bug] lint_design not-an-instance matches components with a different icon #16

Closed
opened 2026-10-25 05:30:33 +00:00 by masi · 0 comments
Owner

Expected: not-an-instance only flags a frame when swapping to the suggested component would keep its look. Instances can't swap icons, so a frame whose icon differs from the main's shouldn't match.
Actual: A chip Status (14px icon phosphor:image-broken + 12px label) is flagged as Canal / Telegram (14px phosphor:telegram-logo + label). A row with phosphor:phone is flagged as an event row whose main uses phosphor:check-circle.
Repro: create a component Chip / A = <div style="display:flex;gap:4px;padding:4px 8px"><x-paper-icon name="phosphor:star" size="14"/><div>A</div></div>. Then write the same markup with phosphor:heart outside a component and run lint_design. It's flagged with swap_instance to Chip / A.
Workaround: ignore the warnings. Lint can't reach zero warnings.
Impact: false warnings stay on every lint run and hide real ones. Following the suggested fix would change the icon.
Also: the fix text says swap_instance, but swap_instance refuses non-instance frames ("is not a component instance root"). The fix has to be write_html replace with <x-paper-instance>.


Filed from PaperCraft 0.7.2 (macos).

**Expected:** `not-an-instance` only flags a frame when swapping to the suggested component would keep its look. Instances can't swap icons, so a frame whose icon differs from the main's shouldn't match. **Actual:** A chip `Status` (14px icon `phosphor:image-broken` + 12px label) is flagged as `Canal / Telegram` (14px `phosphor:telegram-logo` + label). A row with `phosphor:phone` is flagged as an event row whose main uses `phosphor:check-circle`. **Repro:** create a component `Chip / A` = `<div style="display:flex;gap:4px;padding:4px 8px"><x-paper-icon name="phosphor:star" size="14"/><div>A</div></div>`. Then write the same markup with `phosphor:heart` outside a component and run `lint_design`. It's flagged with `swap_instance` to `Chip / A`. **Workaround:** ignore the warnings. Lint can't reach zero warnings. **Impact:** false warnings stay on every lint run and hide real ones. Following the suggested fix would change the icon. Also: the `fix` text says `swap_instance`, but swap_instance refuses non-instance frames ("is not a component instance root"). The fix has to be write_html replace with `<x-paper-instance>`. --- Filed from PaperCraft 0.7.2 (macos).
masi closed this issue 2026-10-25 06:54:23 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: masi/papercraft#16