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

Consider adding rules specific to React Native a11y APIs

Open beefancohen opened this issue 6 years ago • 7 comments

https://facebook.github.io/react-native/docs/accessibility.html

I'm not very familiar with React Native, but I think there's a big opportunity here to help with accessibility across the whole React ecosystem. Not sure if we can support both web and native with the current ruleset, but we can consider using a setting to specify which platform a user is targeting (i.e. platform: 'android' with default set to DOM), or prefix rules with native- like eslint-plugin-react uses the jsx- prefix for rules with JSX.

@jessebeach do you know of anyone that we could loop in for help with this?

beefancohen avatar Jul 07 '17 02:07 beefancohen

I'd say we should keep the current rulesets to web-only, and make new rulesets for native. In general this sounds great!

ljharb avatar Jul 07 '17 04:07 ljharb

A rule for enforcing that all <Touchable*> components have accessibilityTraits and accessibilityComponentType props set, would be awesome! And perhaps accessibilityLabel.

draperunner avatar Feb 20 '18 15:02 draperunner

@necolas do you have any thoughts on this, specifically for RNW?

beefancohen avatar Jun 20 '18 20:06 beefancohen

@jessebeach @ljharb FYI, our team is doing an accessibility hackday on Thursday and we are going to start adding RN(W) rules. I'll move forward with a native prefix to the rules and add a native config.

beefancohen avatar Mar 04 '19 23:03 beefancohen

I'll be interested to discover if the approach suggests that we start a separate project and refactor to share code across the projects.

In any case, I look forward to what you all come up with :)

jessebeach avatar Mar 05 '19 02:03 jessebeach

@evcohen hopefully they'll be specific to all of react native, and not just RNW - if they're RNW-specific, they probably do belong in a separate plugin.

ljharb avatar Mar 05 '19 07:03 ljharb

we don't have a RN codebase to test against, but the APIs are the same. I'm unsure if the same accessibility rules apply in practice. I'll publish an alpha at the end of the day and see if anyone is willing to test against their RN code :)

beefancohen avatar Mar 05 '19 15:03 beefancohen