id: ux-img-no-alt
language: tsx
severity: error
message: <img> without an alt attribute — invisible to screen readers
note: '{"severity":"high","category":"convention","resolution":"Add alt text (alt=\"…\"), or alt=\"\" for purely decorative images (ANTI-SLOP UX §11). Semantic/accessible by default."}'
rule:
  any:
    - all:
        - kind: jsx_self_closing_element
        - has: { field: name, regex: '^img$' }
        - not: { has: { kind: jsx_attribute, regex: '^alt' } }
    - all:
        - kind: jsx_opening_element
        - has: { field: name, regex: '^img$' }
        - not: { has: { kind: jsx_attribute, regex: '^alt' } }
