You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-15Lines changed: 14 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ Eslint-plugin-react-native-a11y is a collection of React Native specific ESLint
8
8
## Setup
9
9
10
10
### Pre-Requisites
11
+
11
12
Before starting, check you already have ESLint as a `devDependency` of your project.
12
13
13
14
> Projects created using `react-native init` will already have this, but for Expo depending on your template you may need to follow ESLint's [installation instructions](https://eslint.org/docs/user-guide/getting-started#installation-and-usage).
|basic|Only use basic validation rules common to both iOS & Android|
37
+
|ios|Use all rules from "basic", plus iOS-specific extras|
38
+
|android|Use all rules from "basic", plus Android-specific extras|
39
+
|all|Use all rules from "basic", plus iOS-specific extras, plus Android-specific extras|
39
40
40
41
If your project only supports a single platform, you may get the best experience using a platform-specific config. This will both avoid reporting issues which do not affect your platform and also results in slightly faster linting for larger projects.
41
42
@@ -48,10 +49,7 @@ Add the config you want to use to the `extends` section of your ESLint config us
@@ -62,12 +60,10 @@ Alternatively if you do not want to use one of the pre-defined configs — or wa
62
60
63
61
module.exports= {
64
62
root:true,
65
-
extends: [
66
-
'@react-native-community',
67
-
],
63
+
extends: ['@react-native-community'],
68
64
rules: {
69
-
'react-native-a11y/rule-name':2
70
-
}
65
+
'react-native-a11y/rule-name':2,
66
+
},
71
67
};
72
68
```
73
69
@@ -76,6 +72,7 @@ For more information on configuring behaviour of an individual rule, please refe
76
72
## Supported Rules
77
73
78
74
### Basic
75
+
79
76
-[has-accessibility-hint](docs/rules/has-accessibility-hint.md): Enforce `accessibilityHint` is used in conjunction with `accessibilityLabel`
80
77
-[has-accessibility-props](docs/rules/has-accessibility-props.md): Enforce that `<Touchable\*>` components only have either the `accessibilityRole` prop or both `accessibilityTraits` and `accessibilityComponentType` props set
81
78
-[has-valid-accessibility-actions](docs/rules/has-valid-accessibility-actions.md): Enforce both `accessibilityActions` and `onAccessibilityAction` props are valid
@@ -89,9 +86,11 @@ For more information on configuring behaviour of an individual rule, please refe
89
86
-[has-valid-accessibility-descriptors](docs/rules/has-valid-accessibility-descriptors.md): Ensures that Touchable* components have appropriate props to communicate with assistive technologies
90
87
91
88
### iOS
89
+
92
90
-[has-valid-accessibility-ignores-invert-colors](docs/rules/has-valid-accessibility-ignores-invert-colors.md): Enforce that certain elements use `accessibilityIgnoresInvertColors` to avoid being inverted by device color settings.
93
91
94
92
### Android
93
+
95
94
-[has-valid-accessibility-live-region](docs/rules/has-valid-accessibility-live-region.md): Enforce `accessibilityLiveRegion` prop values must be valid
96
95
-[has-valid-important-for-accessibility](docs/rules/has-valid-important-for-accessibility.md): Enforce `importantForAccessibility` property value is valid
0 commit comments