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.
src/components/ui/avatar.tsxdefinesAvatarImageas a thin wrapper around<img>, but the wrapper currently does not guarantee analtattribute.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.tsxCurrent result includes:
Expected:
AvatarImageshould either preserve a caller-providedalt, or render a safe empty alt by default for decorative avatar images.