eslint-config-airbnb-extended 0.0.8 → 0.1.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.
Files changed (57) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/base/index.ts +21 -0
  3. package/base/recommended.ts +17 -0
  4. package/index.ts +25 -0
  5. package/package.json +33 -45
  6. package/react/index.ts +11 -0
  7. package/react/recommended.ts +6 -0
  8. package/rules/best-practices.ts +462 -0
  9. package/rules/errors.ts +199 -0
  10. package/rules/es6.ts +224 -0
  11. package/rules/imports.ts +308 -0
  12. package/rules/node.ts +49 -0
  13. package/rules/react-a11y.ts +295 -0
  14. package/rules/react-hooks.ts +26 -0
  15. package/rules/react.ts +692 -0
  16. package/rules/strict.ts +9 -0
  17. package/rules/style.ts +632 -0
  18. package/rules/typescript.ts +312 -0
  19. package/rules/variables.ts +76 -0
  20. package/tsconfig.json +22 -0
  21. package/typescript/index.ts +7 -0
  22. package/typescript/recommended.ts +30 -0
  23. package/README.md +0 -1
  24. package/dist/base/index.d.ts +0 -842
  25. package/dist/base/index.js +0 -25
  26. package/dist/base/recommended.d.ts +0 -2
  27. package/dist/base/recommended.js +0 -33
  28. package/dist/index.d.ts +0 -2639
  29. package/dist/index.js +0 -20
  30. package/dist/react/index.d.ts +0 -1799
  31. package/dist/react/index.js +0 -15
  32. package/dist/react/recommended.d.ts +0 -2
  33. package/dist/react/recommended.js +0 -19
  34. package/dist/rules/best-practices.d.ts +0 -177
  35. package/dist/rules/best-practices.js +0 -379
  36. package/dist/rules/errors.d.ts +0 -69
  37. package/dist/rules/errors.js +0 -151
  38. package/dist/rules/es6.d.ts +0 -146
  39. package/dist/rules/es6.js +0 -203
  40. package/dist/rules/imports.d.ts +0 -2
  41. package/dist/rules/imports.js +0 -265
  42. package/dist/rules/node.d.ts +0 -90
  43. package/dist/rules/node.js +0 -50
  44. package/dist/rules/react-a11y.d.ts +0 -117
  45. package/dist/rules/react-a11y.js +0 -255
  46. package/dist/rules/react-hooks.d.ts +0 -19
  47. package/dist/rules/react-hooks.js +0 -57
  48. package/dist/rules/react.d.ts +0 -1664
  49. package/dist/rules/react.js +0 -606
  50. package/dist/rules/strict.d.ts +0 -7
  51. package/dist/rules/strict.js +0 -9
  52. package/dist/rules/style.d.ts +0 -320
  53. package/dist/rules/style.js +0 -530
  54. package/dist/rules/variables.d.ts +0 -35
  55. package/dist/rules/variables.js +0 -73
  56. package/dist/utils/index.d.ts +0 -1
  57. package/dist/utils/index.js +0 -4
@@ -1,255 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- // @ts-expect-error eslint-plugin-import not working in import
4
- // eslint-disable-next-line @typescript-eslint/no-require-imports,unicorn/prefer-module
5
- var EsLintPluginJSXA11y = require('eslint-plugin-jsx-a11y');
6
- exports.default = {
7
- name: 'airbnb/config/react-a11y',
8
- plugins: {
9
- 'jsx-a11y': EsLintPluginJSXA11y,
10
- },
11
- languageOptions: {
12
- parserOptions: {
13
- ecmaFeatures: {
14
- jsx: true,
15
- },
16
- },
17
- },
18
- rules: {
19
- // ensure emoji are accessible
20
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/accessible-emoji.md
21
- // disabled; rule is deprecated
22
- 'jsx-a11y/accessible-emoji': 'off',
23
- // Enforce that all elements that require alternative text have meaningful information
24
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/alt-text.md
25
- 'jsx-a11y/alt-text': [
26
- 'error',
27
- {
28
- elements: ['img', 'object', 'area', 'input[type="image"]'],
29
- img: [],
30
- object: [],
31
- area: [],
32
- 'input[type="image"]': [],
33
- },
34
- ],
35
- // Enforce that anchors have content
36
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-has-content.md
37
- 'jsx-a11y/anchor-has-content': ['error', { components: [] }],
38
- // ensure <a> tags are valid
39
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/0745af376cdc8686d85a361ce36952b1fb1ccf6e/docs/rules/anchor-is-valid.md
40
- 'jsx-a11y/anchor-is-valid': [
41
- 'error',
42
- {
43
- components: ['Link'],
44
- specialLink: ['to'],
45
- aspects: ['noHref', 'invalidHref', 'preferButton'],
46
- },
47
- ],
48
- // elements with aria-activedescendant must be tabbable
49
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-activedescendant-has-tabindex.md
50
- 'jsx-a11y/aria-activedescendant-has-tabindex': 'error',
51
- // Enforce all aria-* props are valid.
52
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-props.md
53
- 'jsx-a11y/aria-props': 'error',
54
- // Enforce ARIA state and property values are valid.
55
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-proptypes.md
56
- 'jsx-a11y/aria-proptypes': 'error',
57
- // Require ARIA roles to be valid and non-abstract
58
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-role.md
59
- 'jsx-a11y/aria-role': ['error', { ignoreNonDOM: false }],
60
- // Enforce that elements that do not support ARIA roles, states, and
61
- // properties do not have those attributes.
62
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-unsupported-elements.md
63
- 'jsx-a11y/aria-unsupported-elements': 'error',
64
- // 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/29c68596b15c4ff0a40daae6d4a2670e36e37d35/docs/rules/autocomplete-valid.md
66
- 'jsx-a11y/autocomplete-valid': [
67
- 'off',
68
- {
69
- inputComponents: [],
70
- },
71
- ],
72
- // require onClick be accompanied by onKeyUp/onKeyDown/onKeyPress
73
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/click-events-have-key-events.md
74
- 'jsx-a11y/click-events-have-key-events': 'error',
75
- // Enforce that a control (an interactive element) has a text label.
76
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/control-has-associated-label.md
77
- 'jsx-a11y/control-has-associated-label': [
78
- 'error',
79
- {
80
- labelAttributes: ['label'],
81
- controlComponents: [],
82
- ignoreElements: ['audio', 'canvas', 'embed', 'input', 'textarea', 'tr', 'video'],
83
- ignoreRoles: [
84
- 'grid',
85
- 'listbox',
86
- 'menu',
87
- 'menubar',
88
- 'radiogroup',
89
- 'row',
90
- 'tablist',
91
- 'toolbar',
92
- 'tree',
93
- 'treegrid',
94
- ],
95
- depth: 5,
96
- },
97
- ],
98
- // ensure <hX> tags have content and are not aria-hidden
99
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/heading-has-content.md
100
- 'jsx-a11y/heading-has-content': ['error', { components: [''] }],
101
- // require HTML elements to have a "lang" prop
102
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/html-has-lang.md
103
- 'jsx-a11y/html-has-lang': 'error',
104
- // ensure iframe elements have a unique title
105
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/iframe-has-title.md
106
- 'jsx-a11y/iframe-has-title': 'error',
107
- // Prevent img alt text from containing redundant words like "image", "picture", or "photo"
108
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/img-redundant-alt.md
109
- 'jsx-a11y/img-redundant-alt': 'error',
110
- // Elements with an interactive role and interaction handlers must be focusable
111
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/interactive-supports-focus.md
112
- 'jsx-a11y/interactive-supports-focus': 'error',
113
- // Enforce that a label tag has a text label and an associated control.
114
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/b800f40a2a69ad48015ae9226fbe879f946757ed/docs/rules/label-has-associated-control.md
115
- 'jsx-a11y/label-has-associated-control': [
116
- 'error',
117
- {
118
- labelComponents: [],
119
- labelAttributes: [],
120
- controlComponents: [],
121
- assert: 'both',
122
- depth: 25,
123
- },
124
- ],
125
- // require HTML element's lang prop to be valid
126
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/lang.md
127
- 'jsx-a11y/lang': 'error',
128
- // media elements must have captions
129
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/media-has-caption.md
130
- 'jsx-a11y/media-has-caption': [
131
- 'error',
132
- {
133
- audio: [],
134
- video: [],
135
- track: [],
136
- },
137
- ],
138
- // require that mouseover/out come with focus/blur, for keyboard-only users
139
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/mouse-events-have-key-events.md
140
- 'jsx-a11y/mouse-events-have-key-events': 'error',
141
- // Prevent use of `accessKey`
142
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-access-key.md
143
- 'jsx-a11y/no-access-key': 'error',
144
- // prohibit autoFocus prop
145
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-autofocus.md
146
- 'jsx-a11y/no-autofocus': ['error', { ignoreNonDOM: true }],
147
- // prevent distracting elements, like <marquee> and <blink>
148
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-distracting-elements.md
149
- 'jsx-a11y/no-distracting-elements': [
150
- 'error',
151
- {
152
- elements: ['marquee', 'blink'],
153
- },
154
- ],
155
- // 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/master/docs/rules/no-interactive-element-to-noninteractive-role.md
157
- 'jsx-a11y/no-interactive-element-to-noninteractive-role': [
158
- 'error',
159
- {
160
- tr: ['none', 'presentation'],
161
- },
162
- ],
163
- // A non-interactive element does not support event handlers (mouse and key handlers)
164
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-noninteractive-element-interactions.md
165
- 'jsx-a11y/no-noninteractive-element-interactions': [
166
- 'error',
167
- {
168
- handlers: ['onClick', 'onMouseDown', 'onMouseUp', 'onKeyPress', 'onKeyDown', 'onKeyUp'],
169
- },
170
- ],
171
- // 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/master/docs/rules/no-noninteractive-element-to-interactive-role.md
173
- 'jsx-a11y/no-noninteractive-element-to-interactive-role': [
174
- 'error',
175
- {
176
- ul: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'],
177
- ol: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'],
178
- li: ['menuitem', 'option', 'row', 'tab', 'treeitem'],
179
- table: ['grid'],
180
- td: ['gridcell'],
181
- },
182
- ],
183
- // 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/master/docs/rules/no-noninteractive-tabindex.md
185
- 'jsx-a11y/no-noninteractive-tabindex': [
186
- 'error',
187
- {
188
- tags: [],
189
- roles: ['tabpanel'],
190
- allowExpressionValues: true,
191
- },
192
- ],
193
- // require onBlur instead of onChange
194
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-onchange.md
195
- 'jsx-a11y/no-onchange': 'off',
196
- // ensure HTML elements do not specify redundant ARIA roles
197
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-redundant-roles.md
198
- 'jsx-a11y/no-redundant-roles': [
199
- 'error',
200
- {
201
- nav: ['navigation'],
202
- },
203
- ],
204
- // Enforce that DOM elements without semantic behavior not have interaction handlers
205
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md
206
- 'jsx-a11y/no-static-element-interactions': [
207
- 'error',
208
- {
209
- handlers: ['onClick', 'onMouseDown', 'onMouseUp', 'onKeyPress', 'onKeyDown', 'onKeyUp'],
210
- },
211
- ],
212
- // Enforce that elements with ARIA roles must have all required attributes
213
- // for that role.
214
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/role-has-required-aria-props.md
215
- 'jsx-a11y/role-has-required-aria-props': 'error',
216
- // Enforce that elements with explicit or implicit roles defined contain
217
- // only aria-* properties supported by that role.
218
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/role-supports-aria-props.md
219
- 'jsx-a11y/role-supports-aria-props': 'error',
220
- // only allow <th> to have the "scope" attr
221
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/scope.md
222
- 'jsx-a11y/scope': 'error',
223
- // Enforce tabIndex value is not greater than zero.
224
- // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/tabindex-no-positive.md
225
- '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
- },
255
- };
@@ -1,19 +0,0 @@
1
- import * as EsLintPluginReactHooks from 'eslint-plugin-react-hooks';
2
- declare const _default: {
3
- name: string;
4
- plugins: {
5
- 'react-hooks': typeof EsLintPluginReactHooks;
6
- };
7
- languageOptions: {
8
- parserOptions: {
9
- ecmaFeatures: {
10
- jsx: true;
11
- };
12
- };
13
- };
14
- rules: {
15
- 'react-hooks/rules-of-hooks': "error";
16
- 'react-hooks/exhaustive-deps': "error";
17
- };
18
- };
19
- export default _default;
@@ -1,57 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
36
- var EsLintPluginReactHooks = __importStar(require("eslint-plugin-react-hooks"));
37
- exports.default = {
38
- name: 'airbnb/config/react-hooks',
39
- plugins: {
40
- 'react-hooks': EsLintPluginReactHooks,
41
- },
42
- languageOptions: {
43
- parserOptions: {
44
- ecmaFeatures: {
45
- jsx: true,
46
- },
47
- },
48
- },
49
- 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
- // Verify the list of the dependencies for Hooks like useEffect and similar
54
- // https://github.com/facebook/react/blob/1204c789776cb01fbaf3e9f032e7e2ba85a44137/packages/eslint-plugin-react-hooks/src/ExhaustiveDeps.js
55
- 'react-hooks/exhaustive-deps': 'error',
56
- },
57
- };