Ramonda

false-on-a-boolean-attribute

This fails the run. Where it is wrong about your code, // ramonda-check-ignore <reason> on the line says so, and the reason is printed on every run.

Reported when a boolean attribute is written "false", which turns it ON because the parser reads only that it is there.

The framework reports the same fault while running, as RMD029 — but only once the line actually runs. This is the same fault proved from the source instead.

A boolean attribute is true whenever it is PRESENT, whatever it says: the parser never reads the value. So the string "false" turns it ON, which is the opposite of what the line says.

Pass the boolean itself:

<button disabled={false}>Save</button>
<input required={someCondition} />

A false removes the attribute, and removing it is the only way HTML has of turning one off.

This does not apply to aria-*, which are enumerated STRINGS: aria-hidden="false" really does mean "not hidden", and there the empty and absent forms mean a third thing again.

The framework reports it at runtime as RMD029 — but only for markup that renders. This is the same fault found in a branch nobody has opened.

Next