UNPKG

3.01 kBJavaScriptView Raw
1const OFF = 0
2const ERROR = 2
3
4module.exports = {
5 plugins: ['jsx-a11y'],
6 parserOptions: {
7 ecmaFeatures: {
8 jsx: true
9 }
10 },
11 rules: {
12 'jsx-a11y/accessible-emoji': ERROR,
13 'jsx-a11y/alt-text': [
14 ERROR,
15 {
16 elements: ['img', 'object', 'area', 'input[type="image"]'],
17 img: [],
18 object: [],
19 area: [],
20 'input[type="image"]': []
21 }
22 ],
23 'jsx-a11y/anchor-is-valid': [
24 ERROR,
25 {
26 components: ['Link'],
27 specialLink: ['to'],
28 aspects: ['noHref', 'invalidHref', 'preferButton']
29 }
30 ],
31 'jsx-a11y/anchor-has-content': [ERROR, { components: [''] }],
32 'jsx-a11y/aria-activedescendant-has-tabindex': ERROR,
33 'jsx-a11y/aria-props': ERROR,
34 'jsx-a11y/aria-proptypes': ERROR,
35 'jsx-a11y/aria-role': [ERROR, { ignoreNonDom: false }],
36 'jsx-a11y/aria-unsupported-elements': ERROR,
37 'jsx-a11y/click-events-have-key-events': OFF,
38 'jsx-a11y/heading-has-content': [ERROR, { components: [''] }],
39 'jsx-a11y/href-no-hash': [OFF, { components: ['a'] }],
40 'jsx-a11y/html-has-lang': ERROR,
41 'jsx-a11y/iframe-has-title': ERROR,
42 'jsx-a11y/img-redundant-alt': ERROR,
43 'jsx-a11y/interactive-supports-focus': ERROR,
44 'jsx-a11y/label-has-for': [OFF, { components: ['label'] }],
45 'jsx-a11y/lang': ERROR,
46 'jsx-a11y/media-has-caption': [
47 ERROR,
48 {
49 audio: [],
50 video: [],
51 track: []
52 }
53 ],
54 'jsx-a11y/mouse-events-have-key-events': OFF,
55 'jsx-a11y/no-access-key': ERROR,
56 'jsx-a11y/no-autofocus': [ERROR, { ignoreNonDOM: true }],
57 'jsx-a11y/no-distracting-elements': [
58 ERROR,
59 {
60 elements: ['marquee', 'blink']
61 }
62 ],
63 'jsx-a11y/no-interactive-element-to-noninteractive-role': [
64 ERROR,
65 {
66 tr: ['none', 'presentation']
67 }
68 ],
69 'jsx-a11y/no-noninteractive-element-interactions': [
70 ERROR,
71 {
72 handlers: ['onClick', 'onMouseDown', 'onMouseUp', 'onKeyPress', 'onKeyDown', 'onKeyUp']
73 }
74 ],
75 'jsx-a11y/no-noninteractive-element-to-interactive-role': [
76 ERROR,
77 {
78 ul: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'],
79 ol: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'],
80 li: ['menuitem', 'option', 'row', 'tab', 'treeitem'],
81 table: ['grid'],
82 td: ['gridcell']
83 }
84 ],
85 'jsx-a11y/no-noninteractive-tabindex': [
86 ERROR,
87 {
88 tags: [],
89 roles: ['tabpanel']
90 }
91 ],
92 'jsx-a11y/no-onchange': ERROR,
93 'jsx-a11y/no-redundant-roles': ERROR,
94 'jsx-a11y/no-static-element-interactions': [
95 ERROR,
96 {
97 handlers: ['onClick', 'onMouseDown', 'onMouseUp', 'onKeyPress', 'onKeyDown', 'onKeyUp']
98 }
99 ],
100 'jsx-a11y/role-has-required-aria-props': ERROR,
101 'jsx-a11y/role-supports-aria-props': ERROR,
102 'jsx-a11y/scope': ERROR,
103 'jsx-a11y/tabindex-no-positive': ERROR
104 }
105}