Skip to content

AvatarImage allows missing alt text #259

@adliebe

Description

@adliebe

src/components/ui/avatar.tsx defines AvatarImage as a thin wrapper around <img>, but the wrapper currently does not guarantee an alt attribute.

That leaves multiple existing call sites able to render avatar images without alt text. The current lint output also flags the component with jsx-a11y/alt-text.

Repro on current master:

pnpm install --ignore-scripts --frozen-lockfile
pnpm exec eslint src/components/ui/avatar.tsx src/components/ui/avatar.test.tsx

Current result includes:

src/components/ui/avatar.tsx
  23:3  warning  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images  jsx-a11y/alt-text

Expected: AvatarImage should either preserve a caller-provided alt, or render a safe empty alt by default for decorative avatar images.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions