eslint-plugin-jsx-a11y
eslint-plugin-jsx-a11y copied to clipboard
Consider adding rules specific to React Native a11y APIs
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?
I'd say we should keep the current rulesets to web-only, and make new rulesets for native. In general this sounds great!
A rule for enforcing that all <Touchable*>
components have accessibilityTraits
and accessibilityComponentType
props set, would be awesome! And perhaps accessibilityLabel
.
@necolas do you have any thoughts on this, specifically for RNW?
@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.
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 :)
@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.
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 :)