eslint-plugin-jsx-a11y
eslint-plugin-jsx-a11y copied to clipboard
Enable `anchor-is-valid` on more components
react-bootstrap has a Button component that renders as an button-styled anchor when href is supplied. I've just seen <Button href="#" onClick={onClick}> in a codebase, but href="#" does effectively nothing useful here.
Is it possible to enable this rule on more link-based components?
https://react-bootstrap.github.io/components/buttons/#api
Using the "components" setting mentioned in the readme, you can make a Button be considered a button.
However, this is a perfect case for propTypes, which should be banning href when onClick is supplied.