Skip to content

Commit cf8d09f

Browse files
authored
Update README with explanation recommended/strict
Added section to readme that explains the difference between recommended and strict rule configuration.
1 parent c156644 commit cf8d09f

File tree

1 file changed

+123
-0
lines changed

1 file changed

+123
-0
lines changed

README.md

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,130 @@ You can also enable all the recommended rules at once. Add `plugin:jsx-a11y/reco
8989
}
9090
```
9191

92+
### Difference between 'recommended' and 'strict' mode
93+
94+
Rule | Recommended | Strict
95+
------------ | ------------- | -------------
96+
[accessible-emoji](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/accessible-emoji.md) | error | error
97+
[alt-text](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/alt-text.md) | error | error
98+
[anchor-has-content](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-has-content.md) | error | error
99+
[aria-activedescendant-has-tabindex](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-activedescendant-has-tabindex.md) | error | error
100+
[aria-props](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-props.md) | error | error
101+
[aria-proptypes](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-proptypes.md) | error | error
102+
[aria-role](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-role.md) | error | error
103+
[aria-unsupported-elements](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-unsupported-elements.md) | error | error
104+
[click-events-have-key-events](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/click-events-have-key-events.md) | error | error
105+
[heading-has-content](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/heading-has-content.md) | error | error
106+
[href-no-hash](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/href-no-hash.md) | error | error
107+
[html-has-lang](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/html-has-lang.md) | error | error
108+
[iframe-has-title](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/iframe-has-title.md) | error | error
109+
[img-redundant-alt](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/img-redundant-alt.md) | error | error
110+
[interactive-supports-focus](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/interactive-supports-focus.md) | error | error
111+
[label-has-for](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/label-has-for.md) | error | error
112+
[media-has-caption](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/media-has-caption.md) | error | error
113+
[mouse-events-have-key-events](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/mouse-events-have-key-events.md) | error | error
114+
[no-access-key](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-access-key.md) | error | error
115+
[no-autofocus](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-autofocus.md) | error | error
116+
[no-distracting-elements](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-distracting-elements.md) | error | error
117+
[no-interactive-element-to-noninteractive-role](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-interactive-element-to-noninteractive-role.md) | error, with options | error
118+
[no-noninteractive-element-interactions](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-noninteractive-element-interactions.md) | error, with options | error
119+
[no-noninteractive-element-to-interactive-role](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-noninteractive-element-to-interactive-role.md) | error, with options | error
120+
[no-noninteractive-tabindex](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-noninteractive-tabindex.md) | error, with options | error
121+
[no-onchange](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-onchange.md) | error | error
122+
[no-redundant-roles](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-redundant-roles.md) | error | error
123+
[no-static-element-interactions](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md) | error, with options | error
124+
[role-has-required-aria-props](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/role-has-required-aria-props.md) | error | error
125+
[role-supports-aria-props](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/role-supports-aria-props.md) | error | error
126+
[scope](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/scope.md) | error, with options | error
127+
[tabindex-no-positive](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/tabindex-no-positive.md) | error | error
128+
129+
130+
The following rules have extra options when in *recommended* mode:
131+
132+
#### no-interactive-element-to-noninteractive-role
133+
```
134+
'jsx-a11y/no-interactive-element-to-noninteractive-role': [
135+
'error',
136+
{
137+
tr: ['none', 'presentation'],
138+
},
139+
]
140+
```
92141

142+
#### no-noninteractive-element-interactions
143+
```
144+
'jsx-a11y/no-noninteractive-element-interactions': [
145+
'error',
146+
{
147+
handlers: [
148+
'onClick',
149+
'onMouseDown',
150+
'onMouseUp',
151+
'onKeyPress',
152+
'onKeyDown',
153+
'onKeyUp',
154+
],
155+
},
156+
]
157+
```
158+
159+
#### no-noninteractive-element-to-interactive-role
160+
```
161+
'jsx-a11y/no-noninteractive-element-to-interactive-role': [
162+
'error',
163+
{
164+
ul: [
165+
'listbox',
166+
'menu',
167+
'menubar',
168+
'radiogroup',
169+
'tablist',
170+
'tree',
171+
'treegrid',
172+
],
173+
ol: [
174+
'listbox',
175+
'menu',
176+
'menubar',
177+
'radiogroup',
178+
'tablist',
179+
'tree',
180+
'treegrid',
181+
],
182+
li: ['menuitem', 'option', 'row', 'tab', 'treeitem'],
183+
table: ['grid'],
184+
td: ['gridcell'],
185+
},
186+
]
187+
```
188+
189+
#### no-noninteractive-tabindex
190+
```
191+
'jsx-a11y/no-noninteractive-tabindex': [
192+
'error',
193+
{
194+
tags: [],
195+
roles: ['tabpanel'],
196+
},
197+
]
198+
```
199+
200+
#### no-static-element-interactions
201+
```
202+
'jsx-a11y/no-noninteractive-element-interactions': [
203+
'error',
204+
{
205+
handlers: [
206+
'onClick',
207+
'onMouseDown',
208+
'onMouseUp',
209+
'onKeyPress',
210+
'onKeyDown',
211+
'onKeyUp',
212+
],
213+
},
214+
]
215+
```
93216
## Supported Rules
94217

95218
- [accessible-emoji](docs/rules/accessible-emoji.md): Enforce emojis are wrapped in <span> and provide screenreader access.

0 commit comments

Comments
 (0)