eslint-plugin-jsx-a11y icon indicating copy to clipboard operation
eslint-plugin-jsx-a11y copied to clipboard

react-router Link should not either not cause an error, or not detect as a link

Open dbkaplun opened this issue 7 years ago • 5 comments

Related #339

For jsx-a11y/anchor-is-valid, <Link to="foo.html"> causes an error. Why should it cause an error for <Link>? If it's because it knows it's an under the hood, it should support values for to.

Thanks for considering!

dbkaplun avatar Mar 16 '18 16:03 dbkaplun

stumbled upon this one too right now.

derpoho avatar Mar 16 '18 20:03 derpoho

It doesn't know Link is anything under the hood.

If you refer to this comment on the issue you linked, it tells you how to configure things to allow Link and to.

ljharb avatar Mar 16 '18 22:03 ljharb

I'll reopen this since it's about making "to" be a default specialLink also.

ljharb avatar Mar 16 '18 22:03 ljharb

have same issue with Link -rule requires href instead of to

dlebedynskyi avatar Apr 06 '18 18:04 dlebedynskyi

And what about nextjs Link element? The syntax looks like this

import Link from 'next/link';
....
      <Link href="/">
        <a>Go home</a>
      </Link>

FDiskas avatar Oct 21 '20 20:10 FDiskas