link-without-a-destination
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 an <a> has no href, or one that goes nowhere — empty, #, or javascript:.
The tag is not what makes a link; href is. Without a real one an <a> is not focusable, is
not in the tab order, is not announced as a link, and does not answer a middle click, a
context menu or an "open in new tab". It still LOOKS like a link, which is why the page
seems fine.
If it navigates, give it the destination — <a href={…}>, or the Link the router builds,
which writes a real one. If it does not navigate, it is a <button>: that is the element
for something that acts on this page, and it is focusable, announced and keyboard-operable
without anything being written on it.
href="#section" is a real destination and is not reported. Only the bare # is.
Next
- All rules — the other checks this one runs beside.
- Checking your app — how to run it, and what it proves.