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

Custom components should not check for no-access-key rules

Open pfdgithub opened this issue 2 years ago • 6 comments

Succeed

<div />
<CustomComponent accessKey="h" />

Fail

<div accessKey="h" />

pfdgithub avatar Apr 21 '22 02:04 pfdgithub

I agree that this rule should only apply to HTML components; is that not the case?

ljharb avatar Apr 21 '22 04:04 ljharb

it doesn't seem that. image

pfdgithub avatar Apr 24 '22 03:04 pfdgithub

Seems like we should add an option to ignore custom components, and leave a TODO comment to enable it by default in the next major.

ljharb avatar Apr 24 '22 03:04 ljharb

Yes, all rules should not apply to custom components.

pfdgithub avatar Apr 24 '22 03:04 pfdgithub

@ljharb this option to ignore custom components, is it for no-access-key rule only?

V2dha avatar Jul 10 '22 04:07 V2dha

@V2dha This specific issue is only for that rule; but in general, most of the rules in this plugin should probably ignore custom components by default. Since doing so would be semver-major, they'd all need an option to allow for that.

ljharb avatar Jul 10 '22 17:07 ljharb