eslint-config-airbnb-extended 0.0.9 → 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 (63) 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 +12 -31
  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 -841
  25. package/dist/base/index.js +0 -23
  26. package/dist/base/recommended.d.ts +0 -2
  27. package/dist/base/recommended.js +0 -19
  28. package/dist/index.d.ts +0 -2654
  29. package/dist/index.js +0 -29
  30. package/dist/react/index.d.ts +0 -1798
  31. package/dist/react/index.js +0 -13
  32. package/dist/react/recommended.d.ts +0 -2
  33. package/dist/react/recommended.js +0 -8
  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 -192
  40. package/dist/rules/imports.d.ts +0 -157
  41. package/dist/rules/imports.js +0 -256
  42. package/dist/rules/node.d.ts +0 -90
  43. package/dist/rules/node.js +0 -39
  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 -586
  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/typescript.d.ts +0 -4
  55. package/dist/rules/typescript.js +0 -264
  56. package/dist/rules/variables.d.ts +0 -35
  57. package/dist/rules/variables.js +0 -65
  58. package/dist/typescript/index.d.ts +0 -5
  59. package/dist/typescript/index.js +0 -9
  60. package/dist/typescript/recommended.d.ts +0 -6
  61. package/dist/typescript/recommended.js +0 -62
  62. package/dist/utils/index.d.ts +0 -1
  63. package/dist/utils/index.js +0 -4
@@ -1,530 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = {
4
- name: 'airbnb/config/style',
5
- rules: {
6
- // enforce line breaks after opening and before closing array brackets
7
- // https://eslint.org/docs/rules/array-bracket-newline
8
- // TODO: enable? semver-major
9
- 'array-bracket-newline': ['off', 'consistent'], // object option alternative: { multiline: true, minItems: 3 }
10
- // enforce line breaks between array elements
11
- // https://eslint.org/docs/rules/array-element-newline
12
- // TODO: enable? semver-major
13
- 'array-element-newline': ['off', { multiline: true, minItems: 3 }],
14
- // enforce spacing inside array brackets
15
- 'array-bracket-spacing': ['error', 'never'],
16
- // enforce spacing inside single-line blocks
17
- // https://eslint.org/docs/rules/block-spacing
18
- 'block-spacing': ['error', 'always'],
19
- // enforce one true brace style
20
- 'brace-style': ['error', '1tbs', { allowSingleLine: true }],
21
- // require camel case names
22
- camelcase: ['error', { properties: 'never', ignoreDestructuring: false }],
23
- // enforce or disallow capitalization of the first letter of a comment
24
- // https://eslint.org/docs/rules/capitalized-comments
25
- 'capitalized-comments': [
26
- 'off',
27
- 'never',
28
- {
29
- line: {
30
- ignorePattern: '.*',
31
- ignoreInlineComments: true,
32
- ignoreConsecutiveComments: true,
33
- },
34
- block: {
35
- ignorePattern: '.*',
36
- ignoreInlineComments: true,
37
- ignoreConsecutiveComments: true,
38
- },
39
- },
40
- ],
41
- // require trailing commas in multiline object literals
42
- 'comma-dangle': [
43
- 'error',
44
- {
45
- arrays: 'always-multiline',
46
- objects: 'always-multiline',
47
- imports: 'always-multiline',
48
- exports: 'always-multiline',
49
- functions: 'always-multiline',
50
- },
51
- ],
52
- // enforce spacing before and after comma
53
- 'comma-spacing': ['error', { before: false, after: true }],
54
- // enforce one true comma style
55
- 'comma-style': [
56
- 'error',
57
- 'last',
58
- {
59
- exceptions: {
60
- ArrayExpression: false,
61
- ArrayPattern: false,
62
- ArrowFunctionExpression: false,
63
- CallExpression: false,
64
- FunctionDeclaration: false,
65
- FunctionExpression: false,
66
- ImportDeclaration: false,
67
- ObjectExpression: false,
68
- ObjectPattern: false,
69
- VariableDeclaration: false,
70
- NewExpression: false,
71
- },
72
- },
73
- ],
74
- // disallow padding inside computed properties
75
- 'computed-property-spacing': ['error', 'never'],
76
- // enforces consistent naming when capturing the current execution context
77
- 'consistent-this': 'off',
78
- // enforce newline at the end of file, with no multiple empty lines
79
- 'eol-last': ['error', 'always'],
80
- // https://eslint.org/docs/rules/function-call-argument-newline
81
- 'function-call-argument-newline': ['error', 'consistent'],
82
- // enforce spacing between functions and their invocations
83
- // https://eslint.org/docs/rules/func-call-spacing
84
- 'func-call-spacing': ['error', 'never'],
85
- // requires function names to match the name of the variable or property to which they are
86
- // assigned
87
- // https://eslint.org/docs/rules/func-name-matching
88
- 'func-name-matching': [
89
- 'off',
90
- 'always',
91
- {
92
- includeCommonJSModuleExports: false,
93
- considerPropertyDescriptor: true,
94
- },
95
- ],
96
- // require function expressions to have a name
97
- // https://eslint.org/docs/rules/func-names
98
- 'func-names': 'warn',
99
- // enforces use of function declarations or expressions
100
- // https://eslint.org/docs/rules/func-style
101
- // TODO: enable
102
- 'func-style': ['off', 'expression'],
103
- // require line breaks inside function parentheses if there are line breaks between parameters
104
- // https://eslint.org/docs/rules/function-paren-newline
105
- 'function-paren-newline': ['error', 'multiline-arguments'],
106
- // disallow specified identifiers
107
- // https://eslint.org/docs/rules/id-denylist
108
- 'id-denylist': 'off',
109
- // this option enforces minimum and maximum identifier lengths
110
- // (variable names, property names etc.)
111
- 'id-length': 'off',
112
- // require identifiers to match the provided regular expression
113
- 'id-match': 'off',
114
- // Enforce the location of arrow function bodies with implicit returns
115
- // https://eslint.org/docs/rules/implicit-arrow-linebreak
116
- 'implicit-arrow-linebreak': ['error', 'beside'],
117
- // this option sets a specific tab width for your code
118
- // https://eslint.org/docs/rules/indent
119
- indent: [
120
- 'error',
121
- 2,
122
- {
123
- SwitchCase: 1,
124
- VariableDeclarator: 1,
125
- outerIIFEBody: 1,
126
- // MemberExpression: null,
127
- FunctionDeclaration: {
128
- parameters: 1,
129
- body: 1,
130
- },
131
- FunctionExpression: {
132
- parameters: 1,
133
- body: 1,
134
- },
135
- CallExpression: {
136
- arguments: 1,
137
- },
138
- ArrayExpression: 1,
139
- ObjectExpression: 1,
140
- ImportDeclaration: 1,
141
- flatTernaryExpressions: false,
142
- // list derived from https://github.com/benjamn/ast-types/blob/HEAD/def/jsx.js
143
- ignoredNodes: [
144
- 'JSXElement',
145
- 'JSXElement > *',
146
- 'JSXAttribute',
147
- 'JSXIdentifier',
148
- 'JSXNamespacedName',
149
- 'JSXMemberExpression',
150
- 'JSXSpreadAttribute',
151
- 'JSXExpressionContainer',
152
- 'JSXOpeningElement',
153
- 'JSXClosingElement',
154
- 'JSXFragment',
155
- 'JSXOpeningFragment',
156
- 'JSXClosingFragment',
157
- 'JSXText',
158
- 'JSXEmptyExpression',
159
- 'JSXSpreadChild',
160
- ],
161
- ignoreComments: false,
162
- },
163
- ],
164
- // specify whether double or single quotes should be used in JSX attributes
165
- // https://eslint.org/docs/rules/jsx-quotes
166
- 'jsx-quotes': ['off', 'prefer-double'],
167
- // enforces spacing between keys and values in object literal properties
168
- 'key-spacing': ['error', { beforeColon: false, afterColon: true }],
169
- // require a space before & after certain keywords
170
- 'keyword-spacing': [
171
- 'error',
172
- {
173
- before: true,
174
- after: true,
175
- overrides: {
176
- return: { after: true },
177
- throw: { after: true },
178
- case: { after: true },
179
- },
180
- },
181
- ],
182
- // enforce position of line comments
183
- // https://eslint.org/docs/rules/line-comment-position
184
- // TODO: enable?
185
- 'line-comment-position': [
186
- 'off',
187
- {
188
- position: 'above',
189
- ignorePattern: '',
190
- applyDefaultPatterns: true,
191
- },
192
- ],
193
- // disallow mixed 'LF' and 'CRLF' as linebreaks
194
- // https://eslint.org/docs/rules/linebreak-style
195
- 'linebreak-style': ['error', 'unix'],
196
- // require or disallow an empty line between class members
197
- // https://eslint.org/docs/rules/lines-between-class-members
198
- 'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: false }],
199
- // enforces empty lines around comments
200
- 'lines-around-comment': 'off',
201
- // require or disallow newlines around directives
202
- // https://eslint.org/docs/rules/lines-around-directive
203
- 'lines-around-directive': [
204
- 'error',
205
- {
206
- before: 'always',
207
- after: 'always',
208
- },
209
- ],
210
- // Require or disallow logical assignment logical operator shorthand
211
- // https://eslint.org/docs/latest/rules/logical-assignment-operators
212
- // TODO, semver-major: enable
213
- 'logical-assignment-operators': [
214
- 'off',
215
- 'always',
216
- {
217
- enforceForIfStatements: true,
218
- },
219
- ],
220
- // specify the maximum depth that blocks can be nested
221
- 'max-depth': ['off', 4],
222
- // specify the maximum length of a line in your program
223
- // https://eslint.org/docs/rules/max-len
224
- 'max-len': [
225
- 'error',
226
- 100,
227
- 2,
228
- {
229
- ignoreUrls: true,
230
- ignoreComments: false,
231
- ignoreRegExpLiterals: true,
232
- ignoreStrings: true,
233
- ignoreTemplateLiterals: true,
234
- },
235
- ],
236
- // specify the max number of lines in a file
237
- // https://eslint.org/docs/rules/max-lines
238
- 'max-lines': [
239
- 'off',
240
- {
241
- max: 300,
242
- skipBlankLines: true,
243
- skipComments: true,
244
- },
245
- ],
246
- // enforce a maximum function length
247
- // https://eslint.org/docs/rules/max-lines-per-function
248
- 'max-lines-per-function': [
249
- 'off',
250
- {
251
- max: 50,
252
- skipBlankLines: true,
253
- skipComments: true,
254
- IIFEs: true,
255
- },
256
- ],
257
- // specify the maximum depth callbacks can be nested
258
- 'max-nested-callbacks': 'off',
259
- // limits the number of parameters that can be used in the function declaration.
260
- 'max-params': ['off', 3],
261
- // specify the maximum number of statement allowed in a function
262
- 'max-statements': ['off', 10],
263
- // restrict the number of statements per line
264
- // https://eslint.org/docs/rules/max-statements-per-line
265
- 'max-statements-per-line': ['off', { max: 1 }],
266
- // enforce a particular style for multiline comments
267
- // https://eslint.org/docs/rules/multiline-comment-style
268
- 'multiline-comment-style': ['off', 'starred-block'],
269
- // require multiline ternary
270
- // https://eslint.org/docs/rules/multiline-ternary
271
- // TODO: enable?
272
- 'multiline-ternary': ['off', 'never'],
273
- // require a capital letter for constructors
274
- 'new-cap': [
275
- 'error',
276
- {
277
- newIsCap: true,
278
- newIsCapExceptions: [],
279
- capIsNew: false,
280
- capIsNewExceptions: ['Immutable.Map', 'Immutable.Set', 'Immutable.List'],
281
- },
282
- ],
283
- // disallow the omission of parentheses when invoking a constructor with no arguments
284
- // https://eslint.org/docs/rules/new-parens
285
- 'new-parens': 'error',
286
- // allow/disallow an empty newline after var statement
287
- 'newline-after-var': 'off',
288
- // https://eslint.org/docs/rules/newline-before-return
289
- 'newline-before-return': 'off',
290
- // enforces new line after each method call in the chain to make it
291
- // more readable and easy to maintain
292
- // https://eslint.org/docs/rules/newline-per-chained-call
293
- 'newline-per-chained-call': ['error', { ignoreChainWithDepth: 4 }],
294
- // disallow use of the Array constructor
295
- 'no-array-constructor': 'error',
296
- // disallow use of bitwise operators
297
- // https://eslint.org/docs/rules/no-bitwise
298
- 'no-bitwise': 'error',
299
- // disallow use of the continue statement
300
- // https://eslint.org/docs/rules/no-continue
301
- 'no-continue': 'error',
302
- // disallow comments inline after code
303
- 'no-inline-comments': 'off',
304
- // disallow if as the only statement in an else block
305
- // https://eslint.org/docs/rules/no-lonely-if
306
- 'no-lonely-if': 'error',
307
- // disallow un-paren'd mixes of different operators
308
- // https://eslint.org/docs/rules/no-mixed-operators
309
- 'no-mixed-operators': [
310
- 'error',
311
- {
312
- // the list of arithmetic groups disallows mixing `%` and `**`
313
- // with other arithmetic operators.
314
- groups: [
315
- ['%', '**'],
316
- ['%', '+'],
317
- ['%', '-'],
318
- ['%', '*'],
319
- ['%', '/'],
320
- ['/', '*'],
321
- ['&', '|', '<<', '>>', '>>>'],
322
- ['==', '!=', '===', '!=='],
323
- ['&&', '||'],
324
- ],
325
- allowSamePrecedence: false,
326
- },
327
- ],
328
- // disallow mixed spaces and tabs for indentation
329
- 'no-mixed-spaces-and-tabs': 'error',
330
- // disallow use of chained assignment expressions
331
- // https://eslint.org/docs/rules/no-multi-assign
332
- 'no-multi-assign': ['error'],
333
- // disallow multiple empty lines, only one newline at the end, and no new lines at the beginning
334
- // https://eslint.org/docs/rules/no-multiple-empty-lines
335
- 'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],
336
- // disallow negated conditions
337
- // https://eslint.org/docs/rules/no-negated-condition
338
- 'no-negated-condition': 'off',
339
- // disallow nested ternary expressions
340
- 'no-nested-ternary': 'error',
341
- // disallow use of the Object constructor
342
- 'no-new-object': 'error',
343
- // disallow use of unary operators, ++ and --
344
- // https://eslint.org/docs/rules/no-plusplus
345
- 'no-plusplus': 'error',
346
- // disallow certain syntax forms
347
- // https://eslint.org/docs/rules/no-restricted-syntax
348
- 'no-restricted-syntax': [
349
- 'error',
350
- {
351
- selector: 'ForInStatement',
352
- message: 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
353
- },
354
- {
355
- selector: 'ForOfStatement',
356
- message: 'iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations.',
357
- },
358
- {
359
- selector: 'LabeledStatement',
360
- message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
361
- },
362
- {
363
- selector: 'WithStatement',
364
- message: '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
365
- },
366
- ],
367
- // disallow space between function identifier and application
368
- // deprecated in favor of func-call-spacing
369
- 'no-spaced-func': 'off',
370
- // disallow tab characters entirely
371
- 'no-tabs': 'error',
372
- // disallow the use of ternary operators
373
- 'no-ternary': 'off',
374
- // disallow trailing whitespace at the end of lines
375
- 'no-trailing-spaces': [
376
- 'error',
377
- {
378
- skipBlankLines: false,
379
- ignoreComments: false,
380
- },
381
- ],
382
- // disallow dangling underscores in identifiers
383
- // https://eslint.org/docs/rules/no-underscore-dangle
384
- 'no-underscore-dangle': [
385
- 'error',
386
- {
387
- allow: [],
388
- allowAfterThis: false,
389
- allowAfterSuper: false,
390
- enforceInMethodNames: true,
391
- },
392
- ],
393
- // disallow the use of Boolean literals in conditional expressions
394
- // also, prefer `a || b` over `a ? a : b`
395
- // https://eslint.org/docs/rules/no-unneeded-ternary
396
- 'no-unneeded-ternary': ['error', { defaultAssignment: false }],
397
- // disallow whitespace before properties
398
- // https://eslint.org/docs/rules/no-whitespace-before-property
399
- 'no-whitespace-before-property': 'error',
400
- // enforce the location of single-line statements
401
- // https://eslint.org/docs/rules/nonblock-statement-body-position
402
- 'nonblock-statement-body-position': ['error', 'beside', { overrides: {} }],
403
- // require padding inside curly braces
404
- 'object-curly-spacing': ['error', 'always'],
405
- // enforce line breaks between braces
406
- // https://eslint.org/docs/rules/object-curly-newline
407
- 'object-curly-newline': [
408
- 'error',
409
- {
410
- ObjectExpression: { minProperties: 4, multiline: true, consistent: true },
411
- ObjectPattern: { minProperties: 4, multiline: true, consistent: true },
412
- ImportDeclaration: { minProperties: 4, multiline: true, consistent: true },
413
- ExportDeclaration: { minProperties: 4, multiline: true, consistent: true },
414
- },
415
- ],
416
- // enforce "same line" or "multiple line" on object properties.
417
- // https://eslint.org/docs/rules/object-property-newline
418
- 'object-property-newline': [
419
- 'error',
420
- {
421
- allowAllPropertiesOnSameLine: true,
422
- },
423
- ],
424
- // allow just one var statement per function
425
- 'one-var': ['error', 'never'],
426
- // require a newline around variable declaration
427
- // https://eslint.org/docs/rules/one-var-declaration-per-line
428
- 'one-var-declaration-per-line': ['error', 'always'],
429
- // require assignment operator shorthand where possible or prohibit it entirely
430
- // https://eslint.org/docs/rules/operator-assignment
431
- 'operator-assignment': ['error', 'always'],
432
- // Requires operator at the beginning of the line in multiline statements
433
- // https://eslint.org/docs/rules/operator-linebreak
434
- 'operator-linebreak': ['error', 'before', { overrides: { '=': 'none' } }],
435
- // disallow padding within blocks
436
- 'padded-blocks': [
437
- 'error',
438
- {
439
- blocks: 'never',
440
- classes: 'never',
441
- switches: 'never',
442
- },
443
- {
444
- allowSingleLineBlocks: true,
445
- },
446
- ],
447
- // Require or disallow padding lines between statements
448
- // https://eslint.org/docs/rules/padding-line-between-statements
449
- 'padding-line-between-statements': 'off',
450
- // Disallow the use of Math.pow in favor of the ** operator
451
- // https://eslint.org/docs/rules/prefer-exponentiation-operator
452
- 'prefer-exponentiation-operator': 'error',
453
- // Prefer use of an object spread over Object.assign
454
- // https://eslint.org/docs/rules/prefer-object-spread
455
- 'prefer-object-spread': 'error',
456
- // require quotes around object literal property names
457
- // https://eslint.org/docs/rules/quote-props.html
458
- 'quote-props': ['error', 'as-needed', { keywords: false, unnecessary: true, numbers: false }],
459
- // specify whether double or single quotes should be used
460
- quotes: ['error', 'single', { avoidEscape: true }],
461
- // do not require jsdoc
462
- // https://eslint.org/docs/rules/require-jsdoc
463
- 'require-jsdoc': 'off',
464
- // require or disallow use of semicolons instead of ASI
465
- semi: ['error', 'always'],
466
- // enforce spacing before and after semicolons
467
- 'semi-spacing': ['error', { before: false, after: true }],
468
- // Enforce location of semicolons
469
- // https://eslint.org/docs/rules/semi-style
470
- 'semi-style': ['error', 'last'],
471
- // requires object keys to be sorted
472
- 'sort-keys': ['off', 'asc', { caseSensitive: false, natural: true }],
473
- // sort variables within the same declaration block
474
- 'sort-vars': 'off',
475
- // require or disallow space before blocks
476
- 'space-before-blocks': 'error',
477
- // require or disallow space before function opening parenthesis
478
- // https://eslint.org/docs/rules/space-before-function-paren
479
- 'space-before-function-paren': [
480
- 'error',
481
- {
482
- anonymous: 'always',
483
- named: 'never',
484
- asyncArrow: 'always',
485
- },
486
- ],
487
- // require or disallow spaces inside parentheses
488
- 'space-in-parens': ['error', 'never'],
489
- // require spaces around operators
490
- 'space-infix-ops': 'error',
491
- // Require or disallow spaces before/after unary operators
492
- // https://eslint.org/docs/rules/space-unary-ops
493
- 'space-unary-ops': [
494
- 'error',
495
- {
496
- words: true,
497
- nonwords: false,
498
- overrides: {},
499
- },
500
- ],
501
- // require or disallow a space immediately following the // or /* in a comment
502
- // https://eslint.org/docs/rules/spaced-comment
503
- 'spaced-comment': [
504
- 'error',
505
- 'always',
506
- {
507
- line: {
508
- exceptions: ['-', '+'],
509
- markers: ['=', '!', '/'], // space here to support sprockets directives, slash for TS /// comments
510
- },
511
- block: {
512
- exceptions: ['-', '+'],
513
- markers: ['=', '!', ':', '::'], // space here to support sprockets directives and flow comment types
514
- balanced: true,
515
- },
516
- },
517
- ],
518
- // Enforce spacing around colons of switch statements
519
- // https://eslint.org/docs/rules/switch-colon-spacing
520
- 'switch-colon-spacing': ['error', { after: true, before: false }],
521
- // Require or disallow spacing between template tags and their literals
522
- // https://eslint.org/docs/rules/template-tag-spacing
523
- 'template-tag-spacing': ['error', 'never'],
524
- // require or disallow the Unicode Byte Order Mark
525
- // https://eslint.org/docs/rules/unicode-bom
526
- 'unicode-bom': ['error', 'never'],
527
- // require regex literals to be wrapped in parentheses
528
- 'wrap-regex': 'off',
529
- },
530
- };
@@ -1,4 +0,0 @@
1
- import type { Linter } from 'eslint';
2
- export declare const importResolverExtensions: string[];
3
- declare const _default: Linter.Config[];
4
- export default _default;