Skip to content

Commit acb6f31

Browse files
committed
Adding documentation to interactive rule docs
1 parent 71299a0 commit acb6f31

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

docs/rules/no-noninteractive-element-interactions.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,25 @@ Headers often double as expand/collapse controls for the content they headline.
6464

6565
## Rule details
6666

67-
This rule takes no arguments.
67+
You may configure which handler props should be taken into account when applying this rule. The recommended configuration includes the following 6 handlers.
68+
69+
```javascript
70+
'jsx-a11y/no-noninteractive-element-interactions': [
71+
'error',
72+
{
73+
handlers: [
74+
'onClick',
75+
'onMouseDown',
76+
'onMouseUp',
77+
'onKeyPress',
78+
'onKeyDown',
79+
'onKeyUp',
80+
],
81+
},
82+
],
83+
```
84+
85+
Adjust the list of handler prop names in the handlers array to increase or decrease the coverage surface of this rule in your codebase.
6886

6987
### Succeed
7088
```jsx

docs/rules/no-static-element-interactions.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,25 @@ Marking an element with the role `presentation` indicates to assistive technolog
6060

6161
## Rule details
6262

63-
This rule takes no arguments.
63+
You may configure which handler props should be taken into account when applying this rule. The recommended configuration includes the following 6 handlers.
64+
65+
```javascript
66+
'jsx-a11y/no-static-element-interactions': [
67+
'error',
68+
{
69+
handlers: [
70+
'onClick',
71+
'onMouseDown',
72+
'onMouseUp',
73+
'onKeyPress',
74+
'onKeyDown',
75+
'onKeyUp',
76+
],
77+
},
78+
],
79+
```
80+
81+
Adjust the list of handler prop names in the handlers array to increase or decrease the coverage surface of this rule in your codebase.
6482

6583
### Succeed
6684
```jsx

0 commit comments

Comments
 (0)