dislop AI slop linter · v0.8.2

SVG missing viewBox or text overlap

How to judge

Add an explicit viewBox, separate <text> coordinates cleanly, and delete unused gradients or filters from <defs>.

What this rule catches

SVG graphic has structural generation defects: missing viewBox on a large canvas, overlapping <text> coordinates, or >= 2 orphaned <defs> entries.

Before and after examples

Original (flagged)
<svg width="640" height="360"><text x="40" y="50">Step 1</text><text x="42" y="52">Overlap</text></svg>
Fallback trap (still sounds like AI)
<svg viewBox="0 0 640 360" width="640" height="360"><defs><linearGradient id="u1"/><linearGradient id="u2"/></defs><rect width="640" height="360"/></svg>
Clean version
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 360" width="640" height="360"><text x="40" y="50">Step 1</text><text x="40" y="96">Step 2</text></svg>

Edit note: Non-icon SVGs need a responsive viewBox, non-overlapping text coordinates, and zero orphaned <defs> bloat.

Run locally via CLI

npx --yes dislop explain svg-layout-slop
npx --yes dislop check . --pack deck-and-ui

Related guides

Other rules in deck-and-ui