Duolith docs

Warnings while reading a page

W0002 Field without a label

Message <element> has no label, so a screen reader cannot say what it is for

Words in italics are filled in when the compiler reports it, such as the element's name or the list of known ones.

Why

A screen reader announces a field by its accessible name. A placeholder is not one; it disappears once something is typed, and not every target reads it.

How to fix it

Add label="..." saying what the field is for, or labelled-by="..." naming the text that says so. duolith lint --fix labels a field after its placeholder.

In a terminal

duolith explain W0002

Mentioned in