eslint-config-airbnb-extended 0.3.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/@types/index.d.ts +22 -0
- package/dist/configs/base/index.js +26 -0
- package/dist/{base → configs/base}/recommended.js +4 -4
- package/dist/configs/index.js +34 -0
- package/dist/{react → configs/react}/index.js +5 -4
- package/dist/{react → configs/react}/recommended.js +5 -6
- package/dist/configs/typescript/index.js +14 -0
- package/dist/{typescript → configs/typescript}/recommended.js +7 -6
- package/dist/helpers/getDevDepsList.js +1 -2
- package/dist/index.js +11 -37
- package/dist/plugins/index.js +21 -0
- package/dist/plugins/nextPlugin.js +12 -0
- package/dist/plugins/reactA11yPlugin.js +12 -0
- package/dist/plugins/reactHooksPlugin.js +44 -0
- package/dist/plugins/reactPlugin.js +13 -0
- package/dist/plugins/typescriptEslintPlugin.js +13 -0
- package/dist/rules/best-practices.js +65 -42
- package/dist/rules/errors.js +24 -32
- package/dist/rules/es6.js +2 -33
- package/dist/rules/imports.js +9 -14
- package/dist/rules/importsStrict.js +3 -16
- package/dist/rules/index.js +22 -0
- package/dist/rules/next.js +2 -4
- package/dist/rules/node.js +2 -1
- package/dist/rules/react-a11y.js +81 -80
- package/dist/rules/react-hooks.js +6 -42
- package/dist/rules/react.js +374 -340
- package/dist/rules/reactStrict.js +86 -0
- package/dist/rules/strict.js +2 -1
- package/dist/rules/style.js +38 -365
- package/dist/rules/stylistic.js +526 -0
- package/dist/rules/typescript/typescriptBase.js +3 -2
- package/dist/rules/typescript/typescriptEslint.js +22 -34
- package/dist/rules/typescript/typescriptImports.js +8 -4
- package/dist/rules/variables.js +2 -3
- package/package.json +3 -3
- package/dist/base/index.d.ts +0 -990
- package/dist/base/index.js +0 -23
- package/dist/base/recommended.d.ts +0 -990
- package/dist/helpers/getDevDepsList.d.ts +0 -3
- package/dist/index.d.ts +0 -17982
- package/dist/react/index.d.ts +0 -1793
- package/dist/react/recommended.d.ts +0 -2786
- package/dist/rules/best-practices.d.ts +0 -177
- package/dist/rules/errors.d.ts +0 -69
- package/dist/rules/es6.d.ts +0 -146
- package/dist/rules/imports.d.ts +0 -151
- package/dist/rules/importsStrict.d.ts +0 -43
- package/dist/rules/next.d.ts +0 -8
- package/dist/rules/node.d.ts +0 -90
- package/dist/rules/react-a11y.d.ts +0 -117
- package/dist/rules/react-hooks.d.ts +0 -19
- package/dist/rules/react.d.ts +0 -1659
- package/dist/rules/strict.d.ts +0 -7
- package/dist/rules/style.d.ts +0 -320
- package/dist/rules/typescript/typescriptBase.d.ts +0 -23
- package/dist/rules/typescript/typescriptEslint.d.ts +0 -3
- package/dist/rules/typescript/typescriptImports.d.ts +0 -37
- package/dist/rules/typescript.d.ts +0 -47
- package/dist/rules/typescript.js +0 -9
- package/dist/rules/variables.d.ts +0 -35
- package/dist/typescript/index.d.ts +0 -58
- package/dist/typescript/index.js +0 -11
- package/dist/typescript/recommended.d.ts +0 -112
- package/dist/utils/index.d.ts +0 -13
package/dist/rules/react-a11y.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports,unicorn/prefer-module
|
|
5
|
-
const EsLintPluginJSXA11y = require('eslint-plugin-jsx-a11y');
|
|
6
|
-
exports.default = {
|
|
3
|
+
const reactA11yRules = {
|
|
7
4
|
name: 'airbnb/config/react-a11y',
|
|
8
|
-
plugins: {
|
|
9
|
-
'jsx-a11y': EsLintPluginJSXA11y,
|
|
10
|
-
},
|
|
11
5
|
languageOptions: {
|
|
12
6
|
parserOptions: {
|
|
13
7
|
ecmaFeatures: {
|
|
@@ -17,11 +11,11 @@ exports.default = {
|
|
|
17
11
|
},
|
|
18
12
|
rules: {
|
|
19
13
|
// ensure emoji are accessible
|
|
20
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
21
|
-
//
|
|
22
|
-
'jsx-a11y/accessible-emoji': 'off',
|
|
14
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/accessible-emoji.md
|
|
15
|
+
// @deprecated
|
|
16
|
+
// 'jsx-a11y/accessible-emoji': 'off',
|
|
23
17
|
// Enforce that all elements that require alternative text have meaningful information
|
|
24
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
18
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/alt-text.md
|
|
25
19
|
'jsx-a11y/alt-text': [
|
|
26
20
|
'error',
|
|
27
21
|
{
|
|
@@ -32,11 +26,19 @@ exports.default = {
|
|
|
32
26
|
'input[type="image"]': [],
|
|
33
27
|
},
|
|
34
28
|
],
|
|
29
|
+
// Ensures anchor text is not ambiguous
|
|
30
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/anchor-ambiguous-text.md
|
|
31
|
+
'jsx-a11y/anchor-ambiguous-text': 'off',
|
|
35
32
|
// Enforce that anchors have content
|
|
36
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
37
|
-
'jsx-a11y/anchor-has-content': [
|
|
33
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/anchor-has-content.md
|
|
34
|
+
'jsx-a11y/anchor-has-content': [
|
|
35
|
+
'error',
|
|
36
|
+
{
|
|
37
|
+
components: [],
|
|
38
|
+
},
|
|
39
|
+
],
|
|
38
40
|
// ensure <a> tags are valid
|
|
39
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
41
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/anchor-is-valid.md
|
|
40
42
|
'jsx-a11y/anchor-is-valid': [
|
|
41
43
|
'error',
|
|
42
44
|
{
|
|
@@ -46,34 +48,39 @@ exports.default = {
|
|
|
46
48
|
},
|
|
47
49
|
],
|
|
48
50
|
// elements with aria-activedescendant must be tabbable
|
|
49
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
51
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-activedescendant-has-tabindex.md
|
|
50
52
|
'jsx-a11y/aria-activedescendant-has-tabindex': 'error',
|
|
51
53
|
// Enforce all aria-* props are valid.
|
|
52
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
54
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-props.md
|
|
53
55
|
'jsx-a11y/aria-props': 'error',
|
|
54
56
|
// Enforce ARIA state and property values are valid.
|
|
55
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
57
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-proptypes.md
|
|
56
58
|
'jsx-a11y/aria-proptypes': 'error',
|
|
57
59
|
// Require ARIA roles to be valid and non-abstract
|
|
58
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
59
|
-
'jsx-a11y/aria-role': [
|
|
60
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-role.md
|
|
61
|
+
'jsx-a11y/aria-role': [
|
|
62
|
+
'error',
|
|
63
|
+
{
|
|
64
|
+
ignoreNonDOM: false,
|
|
65
|
+
},
|
|
66
|
+
],
|
|
60
67
|
// Enforce that elements that do not support ARIA roles, states, and
|
|
61
68
|
// properties do not have those attributes.
|
|
62
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
69
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-unsupported-elements.md
|
|
63
70
|
'jsx-a11y/aria-unsupported-elements': 'error',
|
|
64
71
|
// Ensure the autocomplete attribute is correct and suitable for the form field it is used with
|
|
65
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
72
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/autocomplete-valid.md
|
|
66
73
|
'jsx-a11y/autocomplete-valid': [
|
|
67
|
-
'
|
|
74
|
+
'error',
|
|
68
75
|
{
|
|
69
|
-
inputComponents: [],
|
|
76
|
+
inputComponents: ['Input'],
|
|
70
77
|
},
|
|
71
78
|
],
|
|
72
79
|
// require onClick be accompanied by onKeyUp/onKeyDown/onKeyPress
|
|
73
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
80
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/click-events-have-key-events.md
|
|
74
81
|
'jsx-a11y/click-events-have-key-events': 'error',
|
|
75
82
|
// Enforce that a control (an interactive element) has a text label.
|
|
76
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
83
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/control-has-associated-label.md
|
|
77
84
|
'jsx-a11y/control-has-associated-label': [
|
|
78
85
|
'error',
|
|
79
86
|
{
|
|
@@ -96,22 +103,27 @@ exports.default = {
|
|
|
96
103
|
},
|
|
97
104
|
],
|
|
98
105
|
// ensure <hX> tags have content and are not aria-hidden
|
|
99
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
100
|
-
'jsx-a11y/heading-has-content': [
|
|
106
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/heading-has-content.md
|
|
107
|
+
'jsx-a11y/heading-has-content': [
|
|
108
|
+
'error',
|
|
109
|
+
{
|
|
110
|
+
components: ['Typography', 'Text'],
|
|
111
|
+
},
|
|
112
|
+
],
|
|
101
113
|
// require HTML elements to have a "lang" prop
|
|
102
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
114
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/html-has-lang.md
|
|
103
115
|
'jsx-a11y/html-has-lang': 'error',
|
|
104
116
|
// ensure iframe elements have a unique title
|
|
105
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
117
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/iframe-has-title.md
|
|
106
118
|
'jsx-a11y/iframe-has-title': 'error',
|
|
107
119
|
// Prevent img alt text from containing redundant words like "image", "picture", or "photo"
|
|
108
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
120
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/img-redundant-alt.md
|
|
109
121
|
'jsx-a11y/img-redundant-alt': 'error',
|
|
110
122
|
// Elements with an interactive role and interaction handlers must be focusable
|
|
111
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
123
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/interactive-supports-focus.md
|
|
112
124
|
'jsx-a11y/interactive-supports-focus': 'error',
|
|
113
125
|
// Enforce that a label tag has a text label and an associated control.
|
|
114
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
126
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/label-has-associated-control.md
|
|
115
127
|
'jsx-a11y/label-has-associated-control': [
|
|
116
128
|
'error',
|
|
117
129
|
{
|
|
@@ -122,11 +134,15 @@ exports.default = {
|
|
|
122
134
|
depth: 25,
|
|
123
135
|
},
|
|
124
136
|
],
|
|
137
|
+
// require that JSX labels use "htmlFor"
|
|
138
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/label-has-for.md
|
|
139
|
+
// @deprecated: replaced by `label-has-associated-control` rule
|
|
140
|
+
// 'jsx-a11y/label-has-for': 'off',
|
|
125
141
|
// require HTML element's lang prop to be valid
|
|
126
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
142
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/lang.md
|
|
127
143
|
'jsx-a11y/lang': 'error',
|
|
128
144
|
// media elements must have captions
|
|
129
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
145
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/media-has-caption.md
|
|
130
146
|
'jsx-a11y/media-has-caption': [
|
|
131
147
|
'error',
|
|
132
148
|
{
|
|
@@ -135,17 +151,25 @@ exports.default = {
|
|
|
135
151
|
track: [],
|
|
136
152
|
},
|
|
137
153
|
],
|
|
138
|
-
// require that mouseover/
|
|
139
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
154
|
+
// require that mouseover/outcome with focus/blur, for keyboard-only users
|
|
155
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/mouse-events-have-key-events.md
|
|
140
156
|
'jsx-a11y/mouse-events-have-key-events': 'error',
|
|
141
157
|
// Prevent use of `accessKey`
|
|
142
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
158
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-access-key.md
|
|
143
159
|
'jsx-a11y/no-access-key': 'error',
|
|
160
|
+
// Enforce that aria-hidden="true" is not set on focusable elements.
|
|
161
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-aria-hidden-on-focusable.md
|
|
162
|
+
'jsx-a11y/no-aria-hidden-on-focusable': 'off',
|
|
144
163
|
// prohibit autoFocus prop
|
|
145
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
146
|
-
'jsx-a11y/no-autofocus': [
|
|
164
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-autofocus.md
|
|
165
|
+
'jsx-a11y/no-autofocus': [
|
|
166
|
+
'error',
|
|
167
|
+
{
|
|
168
|
+
ignoreNonDOM: true,
|
|
169
|
+
},
|
|
170
|
+
],
|
|
147
171
|
// prevent distracting elements, like <marquee> and <blink>
|
|
148
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
172
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-distracting-elements.md
|
|
149
173
|
'jsx-a11y/no-distracting-elements': [
|
|
150
174
|
'error',
|
|
151
175
|
{
|
|
@@ -153,7 +177,7 @@ exports.default = {
|
|
|
153
177
|
},
|
|
154
178
|
],
|
|
155
179
|
// WAI-ARIA roles should not be used to convert an interactive element to non-interactive
|
|
156
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
180
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-interactive-element-to-noninteractive-role.md
|
|
157
181
|
'jsx-a11y/no-interactive-element-to-noninteractive-role': [
|
|
158
182
|
'error',
|
|
159
183
|
{
|
|
@@ -161,7 +185,7 @@ exports.default = {
|
|
|
161
185
|
},
|
|
162
186
|
],
|
|
163
187
|
// A non-interactive element does not support event handlers (mouse and key handlers)
|
|
164
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
188
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-noninteractive-element-interactions.md
|
|
165
189
|
'jsx-a11y/no-noninteractive-element-interactions': [
|
|
166
190
|
'error',
|
|
167
191
|
{
|
|
@@ -169,7 +193,7 @@ exports.default = {
|
|
|
169
193
|
},
|
|
170
194
|
],
|
|
171
195
|
// WAI-ARIA roles should not be used to convert a non-interactive element to interactive
|
|
172
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
196
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-noninteractive-element-to-interactive-role.md
|
|
173
197
|
'jsx-a11y/no-noninteractive-element-to-interactive-role': [
|
|
174
198
|
'error',
|
|
175
199
|
{
|
|
@@ -181,7 +205,7 @@ exports.default = {
|
|
|
181
205
|
},
|
|
182
206
|
],
|
|
183
207
|
// Tab key navigation should be limited to elements on the page that can be interacted with.
|
|
184
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
208
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-noninteractive-tabindex.md
|
|
185
209
|
'jsx-a11y/no-noninteractive-tabindex': [
|
|
186
210
|
'error',
|
|
187
211
|
{
|
|
@@ -191,10 +215,11 @@ exports.default = {
|
|
|
191
215
|
},
|
|
192
216
|
],
|
|
193
217
|
// require onBlur instead of onChange
|
|
194
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
195
|
-
|
|
218
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-onchange.md
|
|
219
|
+
// @deprecated
|
|
220
|
+
// 'jsx-a11y/no-onchange': 'off',
|
|
196
221
|
// ensure HTML elements do not specify redundant ARIA roles
|
|
197
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
222
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-redundant-roles.md
|
|
198
223
|
'jsx-a11y/no-redundant-roles': [
|
|
199
224
|
'error',
|
|
200
225
|
{
|
|
@@ -202,54 +227,30 @@ exports.default = {
|
|
|
202
227
|
},
|
|
203
228
|
],
|
|
204
229
|
// Enforce that DOM elements without semantic behavior not have interaction handlers
|
|
205
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
230
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-static-element-interactions.md
|
|
206
231
|
'jsx-a11y/no-static-element-interactions': [
|
|
207
232
|
'error',
|
|
208
233
|
{
|
|
209
234
|
handlers: ['onClick', 'onMouseDown', 'onMouseUp', 'onKeyPress', 'onKeyDown', 'onKeyUp'],
|
|
210
235
|
},
|
|
211
236
|
],
|
|
237
|
+
// Enforces using semantic DOM elements over the ARIA role property.
|
|
238
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/prefer-tag-over-role.md
|
|
239
|
+
'jsx-a11y/prefer-tag-over-role': 'off',
|
|
212
240
|
// Enforce that elements with ARIA roles must have all required attributes
|
|
213
241
|
// for that role.
|
|
214
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
242
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/role-has-required-aria-props.md
|
|
215
243
|
'jsx-a11y/role-has-required-aria-props': 'error',
|
|
216
244
|
// Enforce that elements with explicit or implicit roles defined contain
|
|
217
245
|
// only aria-* properties supported by that role.
|
|
218
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
246
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/role-supports-aria-props.md
|
|
219
247
|
'jsx-a11y/role-supports-aria-props': 'error',
|
|
220
248
|
// only allow <th> to have the "scope" attr
|
|
221
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
249
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/scope.md
|
|
222
250
|
'jsx-a11y/scope': 'error',
|
|
223
251
|
// Enforce tabIndex value is not greater than zero.
|
|
224
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/
|
|
252
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/tabindex-no-positive.md
|
|
225
253
|
'jsx-a11y/tabindex-no-positive': 'error',
|
|
226
|
-
// ----------------------------------------------------
|
|
227
|
-
// Rules that no longer exist in eslint-plugin-jsx-a11y
|
|
228
|
-
// ----------------------------------------------------
|
|
229
|
-
// require that JSX labels use "htmlFor"
|
|
230
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/label-has-for.md
|
|
231
|
-
// deprecated: replaced by `label-has-associated-control` rule
|
|
232
|
-
'jsx-a11y/label-has-for': [
|
|
233
|
-
'off',
|
|
234
|
-
{
|
|
235
|
-
components: [],
|
|
236
|
-
required: {
|
|
237
|
-
every: ['nesting', 'id'],
|
|
238
|
-
},
|
|
239
|
-
allowChildren: false,
|
|
240
|
-
},
|
|
241
|
-
],
|
|
242
|
-
// Ensures anchor text is not ambiguous
|
|
243
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/93f78856655696a55309440593e0948c6fb96134/docs/rules/anchor-ambiguous-text.md
|
|
244
|
-
// TODO: semver-major, enable
|
|
245
|
-
'jsx-a11y/anchor-ambiguous-text': 'off',
|
|
246
|
-
// Enforce that aria-hidden="true" is not set on focusable elements.
|
|
247
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/93f78856655696a55309440593e0948c6fb96134/docs/rules/no-aria-hidden-on-focusable.md
|
|
248
|
-
// TODO: semver-major, enable
|
|
249
|
-
'jsx-a11y/no-aria-hidden-on-focusable': 'off',
|
|
250
|
-
// Enforces using semantic DOM elements over the ARIA role property.
|
|
251
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/93f78856655696a55309440593e0948c6fb96134/docs/rules/prefer-tag-over-role.md
|
|
252
|
-
// TODO: semver-major, enable
|
|
253
|
-
'jsx-a11y/prefer-tag-over-role': 'off',
|
|
254
254
|
},
|
|
255
255
|
};
|
|
256
|
+
exports.default = reactA11yRules;
|
|
@@ -1,44 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const
|
|
37
|
-
exports.default = {
|
|
3
|
+
const reactHooksRules = {
|
|
38
4
|
name: 'airbnb/config/react-hooks',
|
|
39
|
-
plugins: {
|
|
40
|
-
'react-hooks': EsLintPluginReactHooks,
|
|
41
|
-
},
|
|
42
5
|
languageOptions: {
|
|
43
6
|
parserOptions: {
|
|
44
7
|
ecmaFeatures: {
|
|
@@ -47,11 +10,12 @@ exports.default = {
|
|
|
47
10
|
},
|
|
48
11
|
},
|
|
49
12
|
rules: {
|
|
50
|
-
// Enforce Rules of Hooks
|
|
51
|
-
// https://github.com/facebook/react/blob/c11015ff4f610ac2924d1fc6d569a17657a404fd/packages/eslint-plugin-react-hooks/src/RulesOfHooks.js
|
|
52
|
-
'react-hooks/rules-of-hooks': 'error',
|
|
53
13
|
// Verify the list of the dependencies for Hooks like useEffect and similar
|
|
54
|
-
// https://github.com/facebook/react/blob/
|
|
14
|
+
// https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/src/rules/ExhaustiveDeps.ts
|
|
55
15
|
'react-hooks/exhaustive-deps': 'error',
|
|
16
|
+
// Enforce Rules of Hooks
|
|
17
|
+
// https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/src/rules/RulesOfHooks.ts
|
|
18
|
+
'react-hooks/rules-of-hooks': 'error',
|
|
56
19
|
},
|
|
57
20
|
};
|
|
21
|
+
exports.default = reactHooksRules;
|