forked from gajus/eslint-config-canonical
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jsx-a11y.js
129 lines (129 loc) · 3.13 KB
/
jsx-a11y.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
module.exports.recommended = {
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
plugins: {
'jsx-a11y': require('eslint-plugin-jsx-a11y'),
},
rules: {
'jsx-a11y/alt-text': 2,
'jsx-a11y/anchor-has-content': 2,
'jsx-a11y/anchor-is-valid': 2,
'jsx-a11y/aria-activedescendant-has-tabindex': 2,
'jsx-a11y/aria-props': 2,
'jsx-a11y/aria-proptypes': 2,
'jsx-a11y/aria-role': 2,
'jsx-a11y/aria-unsupported-elements': 2,
'jsx-a11y/autocomplete-valid': 2,
'jsx-a11y/click-events-have-key-events': 2,
'jsx-a11y/control-has-associated-label': 0,
'jsx-a11y/heading-has-content': 2,
'jsx-a11y/html-has-lang': 2,
'jsx-a11y/iframe-has-title': 2,
'jsx-a11y/img-redundant-alt': 2,
'jsx-a11y/interactive-supports-focus': [
2,
{
tabbable: [
'button',
'checkbox',
'link',
'searchbox',
'spinbutton',
'switch',
'textbox',
],
},
],
'jsx-a11y/label-has-associated-control': 2,
'jsx-a11y/lang': 0,
'jsx-a11y/media-has-caption': 2,
'jsx-a11y/mouse-events-have-key-events': 2,
'jsx-a11y/no-access-key': 2,
'jsx-a11y/no-autofocus': 0,
'jsx-a11y/no-distracting-elements': 2,
'jsx-a11y/no-interactive-element-to-noninteractive-role': [
2,
{
canvas: ['img'],
tr: ['none', 'presentation'],
},
],
'jsx-a11y/no-noninteractive-element-interactions': [
2,
{
alert: ['onKeyUp', 'onKeyDown', 'onKeyPress'],
body: ['onError', 'onLoad'],
dialog: ['onKeyUp', 'onKeyDown', 'onKeyPress'],
handlers: [
'onClick',
'onError',
'onLoad',
'onMouseDown',
'onMouseUp',
'onKeyPress',
'onKeyDown',
'onKeyUp',
],
iframe: ['onError', 'onLoad'],
img: ['onError', 'onLoad'],
},
],
'jsx-a11y/no-noninteractive-element-to-interactive-role': [
2,
{
fieldset: ['radiogroup', 'presentation'],
li: ['menuitem', 'option', 'row', 'tab', 'treeitem'],
ol: [
'listbox',
'menu',
'menubar',
'radiogroup',
'tablist',
'tree',
'treegrid',
],
table: ['grid'],
td: ['gridcell'],
ul: [
'listbox',
'menu',
'menubar',
'radiogroup',
'tablist',
'tree',
'treegrid',
],
},
],
'jsx-a11y/no-noninteractive-tabindex': [
2,
{
allowExpressionValues: true,
roles: ['tabpanel'],
tags: [],
},
],
'jsx-a11y/no-redundant-roles': 2,
'jsx-a11y/no-static-element-interactions': [
2,
{
allowExpressionValues: true,
handlers: [
'onClick',
'onMouseDown',
'onMouseUp',
'onKeyPress',
'onKeyDown',
'onKeyUp',
],
},
],
'jsx-a11y/role-has-required-aria-props': 2,
'jsx-a11y/role-supports-aria-props': 2,
'jsx-a11y/scope': 2,
'jsx-a11y/tabindex-no-positive': 2,
},
};