eslint-config-xo 0.39.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/browser.js +17 -0
- package/index.js +595 -0
- package/license +9 -0
- package/package.json +63 -0
- package/readme.md +70 -0
package/browser.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const confusingBrowserGlobals = require('confusing-browser-globals');
|
|
4
|
+
|
|
5
|
+
module.exports = {
|
|
6
|
+
extends: path.join(__dirname, 'index.js'),
|
|
7
|
+
env: {
|
|
8
|
+
node: false,
|
|
9
|
+
browser: true
|
|
10
|
+
},
|
|
11
|
+
rules: {
|
|
12
|
+
'no-restricted-globals': [
|
|
13
|
+
'error',
|
|
14
|
+
...confusingBrowserGlobals
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
};
|
package/index.js
ADDED
|
@@ -0,0 +1,595 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
parserOptions: {
|
|
5
|
+
ecmaVersion: 'latest',
|
|
6
|
+
sourceType: 'module',
|
|
7
|
+
ecmaFeatures: {
|
|
8
|
+
jsx: true
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
env: {
|
|
12
|
+
es2021: true,
|
|
13
|
+
node: true
|
|
14
|
+
},
|
|
15
|
+
reportUnusedDisableDirectives: true,
|
|
16
|
+
rules: {
|
|
17
|
+
'comma-dangle': [
|
|
18
|
+
'error',
|
|
19
|
+
'always-multiline'
|
|
20
|
+
],
|
|
21
|
+
'for-direction': 'error',
|
|
22
|
+
'getter-return': 'error',
|
|
23
|
+
'no-async-promise-executor': 'error',
|
|
24
|
+
'no-await-in-loop': 'error',
|
|
25
|
+
'no-compare-neg-zero': 'error',
|
|
26
|
+
'no-cond-assign': 'error',
|
|
27
|
+
'no-constant-condition': 'error',
|
|
28
|
+
'no-control-regex': 'error',
|
|
29
|
+
'no-debugger': 'error',
|
|
30
|
+
'no-dupe-args': 'error',
|
|
31
|
+
'no-dupe-else-if': 'error',
|
|
32
|
+
'no-dupe-keys': 'error',
|
|
33
|
+
'no-duplicate-case': 'error',
|
|
34
|
+
'no-empty-character-class': 'error',
|
|
35
|
+
'no-empty': [
|
|
36
|
+
'error',
|
|
37
|
+
{
|
|
38
|
+
allowEmptyCatch: true
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
'no-ex-assign': 'error',
|
|
42
|
+
'no-extra-boolean-cast': 'error',
|
|
43
|
+
// Disabled because of https://github.com/eslint/eslint/issues/6028
|
|
44
|
+
// 'no-extra-parens': [
|
|
45
|
+
// 'error',
|
|
46
|
+
// 'all',
|
|
47
|
+
// {
|
|
48
|
+
// conditionalAssign: false,
|
|
49
|
+
// nestedBinaryExpressions: false,
|
|
50
|
+
// ignoreJSX: 'multi-line'
|
|
51
|
+
// }
|
|
52
|
+
// ],
|
|
53
|
+
'no-extra-semi': 'error',
|
|
54
|
+
'no-func-assign': 'error',
|
|
55
|
+
'no-import-assign': 'error',
|
|
56
|
+
'no-inner-declarations': 'error',
|
|
57
|
+
'no-invalid-regexp': 'error',
|
|
58
|
+
'no-irregular-whitespace': 'error',
|
|
59
|
+
'no-loss-of-precision': 'error',
|
|
60
|
+
'no-misleading-character-class': 'error',
|
|
61
|
+
'no-obj-calls': 'error',
|
|
62
|
+
'no-promise-executor-return': 'error',
|
|
63
|
+
'no-prototype-builtins': 'error',
|
|
64
|
+
'no-regex-spaces': 'error',
|
|
65
|
+
'no-setter-return': 'error',
|
|
66
|
+
'no-sparse-arrays': 'error',
|
|
67
|
+
'no-template-curly-in-string': 'error',
|
|
68
|
+
'no-unreachable': 'error',
|
|
69
|
+
'no-unreachable-loop': 'error',
|
|
70
|
+
'no-unsafe-finally': 'error',
|
|
71
|
+
'no-unsafe-negation': [
|
|
72
|
+
'error',
|
|
73
|
+
{
|
|
74
|
+
enforceForOrderingRelations: true
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
'no-unsafe-optional-chaining': [
|
|
78
|
+
'error',
|
|
79
|
+
{
|
|
80
|
+
disallowArithmeticOperators: true
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
'no-useless-backreference': 'error',
|
|
84
|
+
'use-isnan': 'error',
|
|
85
|
+
'valid-typeof': [
|
|
86
|
+
'error',
|
|
87
|
+
{
|
|
88
|
+
requireStringLiterals: false
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
'no-unexpected-multiline': 'error',
|
|
92
|
+
'accessor-pairs': [
|
|
93
|
+
'error',
|
|
94
|
+
{
|
|
95
|
+
enforceForClassMembers: true
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
'array-callback-return': [
|
|
99
|
+
'error',
|
|
100
|
+
{
|
|
101
|
+
allowImplicit: true
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
'block-scoped-var': 'error',
|
|
105
|
+
complexity: 'warn',
|
|
106
|
+
curly: 'error',
|
|
107
|
+
'default-case': 'error',
|
|
108
|
+
'default-case-last': 'error',
|
|
109
|
+
'default-param-last': 'error',
|
|
110
|
+
'dot-notation': 'error',
|
|
111
|
+
'dot-location': [
|
|
112
|
+
'error',
|
|
113
|
+
'property'
|
|
114
|
+
],
|
|
115
|
+
eqeqeq: 'error',
|
|
116
|
+
'grouped-accessor-pairs': [
|
|
117
|
+
'error',
|
|
118
|
+
'getBeforeSet'
|
|
119
|
+
],
|
|
120
|
+
'guard-for-in': 'error',
|
|
121
|
+
'no-alert': 'error',
|
|
122
|
+
'no-caller': 'error',
|
|
123
|
+
'no-case-declarations': 'error',
|
|
124
|
+
'no-constructor-return': 'error',
|
|
125
|
+
'no-else-return': [
|
|
126
|
+
'error',
|
|
127
|
+
{
|
|
128
|
+
allowElseIf: false
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
'no-empty-pattern': 'error',
|
|
132
|
+
'no-eq-null': 'error',
|
|
133
|
+
'no-eval': 'error',
|
|
134
|
+
'no-extend-native': 'error',
|
|
135
|
+
'no-extra-bind': 'error',
|
|
136
|
+
'no-extra-label': 'error',
|
|
137
|
+
'no-fallthrough': 'error',
|
|
138
|
+
'no-floating-decimal': 'error',
|
|
139
|
+
'no-global-assign': 'error',
|
|
140
|
+
'no-implicit-coercion': 'error',
|
|
141
|
+
'no-implicit-globals': 'error',
|
|
142
|
+
'no-implied-eval': 'error',
|
|
143
|
+
'no-iterator': 'error',
|
|
144
|
+
'no-labels': 'error',
|
|
145
|
+
'no-lone-blocks': 'error',
|
|
146
|
+
'no-multi-spaces': 'error',
|
|
147
|
+
'no-multi-str': 'error',
|
|
148
|
+
'no-new-func': 'error',
|
|
149
|
+
'no-new-wrappers': 'error',
|
|
150
|
+
'no-nonoctal-decimal-escape': 'error',
|
|
151
|
+
'no-new': 'error',
|
|
152
|
+
'no-octal-escape': 'error',
|
|
153
|
+
'no-octal': 'error',
|
|
154
|
+
'no-proto': 'error',
|
|
155
|
+
'no-redeclare': 'error',
|
|
156
|
+
'no-return-assign': [
|
|
157
|
+
'error',
|
|
158
|
+
'always'
|
|
159
|
+
],
|
|
160
|
+
'no-return-await': 'error',
|
|
161
|
+
'no-script-url': 'error',
|
|
162
|
+
'no-self-assign': [
|
|
163
|
+
'error',
|
|
164
|
+
{
|
|
165
|
+
props: true
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
'no-self-compare': 'error',
|
|
169
|
+
'no-sequences': 'error',
|
|
170
|
+
'no-throw-literal': 'error',
|
|
171
|
+
'no-unmodified-loop-condition': 'error',
|
|
172
|
+
'no-unused-expressions': [
|
|
173
|
+
'error',
|
|
174
|
+
{
|
|
175
|
+
enforceForJSX: true
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
'no-unused-labels': 'error',
|
|
179
|
+
'no-useless-call': 'error',
|
|
180
|
+
'no-useless-catch': 'error',
|
|
181
|
+
'no-useless-concat': 'error',
|
|
182
|
+
'no-useless-escape': 'error',
|
|
183
|
+
'no-useless-return': 'error',
|
|
184
|
+
'no-void': 'error',
|
|
185
|
+
'no-warning-comments': 'warn',
|
|
186
|
+
'no-with': 'error',
|
|
187
|
+
|
|
188
|
+
// Disabled for now as Firefox doesn't support named capture groups and I'm tired of getting issues about the use of named capture groups...
|
|
189
|
+
// 'prefer-named-capture-group': 'error'
|
|
190
|
+
|
|
191
|
+
'prefer-promise-reject-errors': [
|
|
192
|
+
'error',
|
|
193
|
+
{
|
|
194
|
+
allowEmptyReject: true
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
'prefer-regex-literals': 'error',
|
|
198
|
+
radix: 'error',
|
|
199
|
+
|
|
200
|
+
// Disabled for now as it causes too much churn
|
|
201
|
+
// TODO: Enable it in the future when I have time to deal with
|
|
202
|
+
// the churn and the rule is stable and has an autofixer.
|
|
203
|
+
// Still doesn't have a fixer as of ESLint 7.24.0.
|
|
204
|
+
// 'require-unicode-regexp': 'error',
|
|
205
|
+
|
|
206
|
+
'wrap-iife': [
|
|
207
|
+
'error',
|
|
208
|
+
'inside',
|
|
209
|
+
{
|
|
210
|
+
functionPrototypeMethods: true
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
yoda: 'error',
|
|
214
|
+
'no-delete-var': 'error',
|
|
215
|
+
'no-label-var': 'error',
|
|
216
|
+
'no-restricted-globals': [
|
|
217
|
+
'error',
|
|
218
|
+
'event'
|
|
219
|
+
],
|
|
220
|
+
'no-shadow-restricted-names': 'error',
|
|
221
|
+
'no-undef-init': 'error',
|
|
222
|
+
'no-undef': [
|
|
223
|
+
'error',
|
|
224
|
+
{
|
|
225
|
+
typeof: true
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
'no-unused-vars': [
|
|
229
|
+
'error',
|
|
230
|
+
{
|
|
231
|
+
vars: 'all',
|
|
232
|
+
args: 'after-used',
|
|
233
|
+
ignoreRestSiblings: true,
|
|
234
|
+
argsIgnorePattern: /^_/.source,
|
|
235
|
+
caughtErrors: 'all',
|
|
236
|
+
caughtErrorsIgnorePattern: /^_$/.source
|
|
237
|
+
}
|
|
238
|
+
],
|
|
239
|
+
'no-buffer-constructor': 'error',
|
|
240
|
+
'no-restricted-imports': [
|
|
241
|
+
'error',
|
|
242
|
+
'domain',
|
|
243
|
+
'freelist',
|
|
244
|
+
'smalloc',
|
|
245
|
+
'punycode',
|
|
246
|
+
'sys',
|
|
247
|
+
'querystring',
|
|
248
|
+
'colors'
|
|
249
|
+
],
|
|
250
|
+
'array-bracket-newline': [
|
|
251
|
+
'error',
|
|
252
|
+
'consistent'
|
|
253
|
+
],
|
|
254
|
+
'array-bracket-spacing': [
|
|
255
|
+
'error',
|
|
256
|
+
'never'
|
|
257
|
+
],
|
|
258
|
+
'array-element-newline': [
|
|
259
|
+
'error',
|
|
260
|
+
'consistent'
|
|
261
|
+
],
|
|
262
|
+
'brace-style': [
|
|
263
|
+
'error',
|
|
264
|
+
'1tbs',
|
|
265
|
+
{
|
|
266
|
+
allowSingleLine: false
|
|
267
|
+
}
|
|
268
|
+
],
|
|
269
|
+
camelcase: [
|
|
270
|
+
'error',
|
|
271
|
+
{
|
|
272
|
+
properties: 'always'
|
|
273
|
+
}
|
|
274
|
+
],
|
|
275
|
+
'capitalized-comments': [
|
|
276
|
+
'error',
|
|
277
|
+
'always',
|
|
278
|
+
{
|
|
279
|
+
// You can also ignore this rule by wrapping the first word in quotes.
|
|
280
|
+
// c8 => https://github.com/bcoe/c8
|
|
281
|
+
ignorePattern: /pragma|ignore|prettier-ignore|webpack\w+:|c8/.source,
|
|
282
|
+
ignoreInlineComments: true,
|
|
283
|
+
ignoreConsecutiveComments: true
|
|
284
|
+
}
|
|
285
|
+
],
|
|
286
|
+
'comma-spacing': [
|
|
287
|
+
'error',
|
|
288
|
+
{
|
|
289
|
+
before: false,
|
|
290
|
+
after: true
|
|
291
|
+
}
|
|
292
|
+
],
|
|
293
|
+
'comma-style': [
|
|
294
|
+
'error',
|
|
295
|
+
'last'
|
|
296
|
+
],
|
|
297
|
+
'computed-property-spacing': [
|
|
298
|
+
'error',
|
|
299
|
+
'never',
|
|
300
|
+
{
|
|
301
|
+
enforceForClassMembers: true
|
|
302
|
+
}
|
|
303
|
+
],
|
|
304
|
+
'eol-last': 'error',
|
|
305
|
+
'func-call-spacing': [
|
|
306
|
+
'error',
|
|
307
|
+
'never'
|
|
308
|
+
],
|
|
309
|
+
'func-name-matching': [
|
|
310
|
+
'error',
|
|
311
|
+
{
|
|
312
|
+
considerPropertyDescriptor: true
|
|
313
|
+
}
|
|
314
|
+
],
|
|
315
|
+
'func-names': [
|
|
316
|
+
'error',
|
|
317
|
+
'never'
|
|
318
|
+
],
|
|
319
|
+
'function-call-argument-newline': [
|
|
320
|
+
'error',
|
|
321
|
+
'consistent'
|
|
322
|
+
],
|
|
323
|
+
indent: [
|
|
324
|
+
'error',
|
|
325
|
+
'tab',
|
|
326
|
+
{
|
|
327
|
+
SwitchCase: 1
|
|
328
|
+
}
|
|
329
|
+
],
|
|
330
|
+
'jsx-quotes': 'error',
|
|
331
|
+
'key-spacing': [
|
|
332
|
+
'error',
|
|
333
|
+
{
|
|
334
|
+
beforeColon: false,
|
|
335
|
+
afterColon: true
|
|
336
|
+
}
|
|
337
|
+
],
|
|
338
|
+
'keyword-spacing': 'error',
|
|
339
|
+
'linebreak-style': [
|
|
340
|
+
process.platform === 'win32' ? 'off' : 'error',
|
|
341
|
+
'unix'
|
|
342
|
+
],
|
|
343
|
+
'lines-between-class-members': [
|
|
344
|
+
'error',
|
|
345
|
+
'always',
|
|
346
|
+
{
|
|
347
|
+
// Workaround to allow class fields to not have lines between them.
|
|
348
|
+
// TODO: Get ESLint to add an option to ignore class fields.
|
|
349
|
+
exceptAfterSingleLine: true
|
|
350
|
+
}
|
|
351
|
+
],
|
|
352
|
+
'max-depth': 'warn',
|
|
353
|
+
'max-nested-callbacks': [
|
|
354
|
+
'warn',
|
|
355
|
+
4
|
|
356
|
+
],
|
|
357
|
+
'max-params': [
|
|
358
|
+
'warn',
|
|
359
|
+
{
|
|
360
|
+
max: 4
|
|
361
|
+
}
|
|
362
|
+
],
|
|
363
|
+
'max-statements-per-line': 'error',
|
|
364
|
+
'new-cap': [
|
|
365
|
+
'error',
|
|
366
|
+
{
|
|
367
|
+
newIsCap: true,
|
|
368
|
+
capIsNew: true
|
|
369
|
+
}
|
|
370
|
+
],
|
|
371
|
+
'new-parens': 'error',
|
|
372
|
+
'no-array-constructor': 'error',
|
|
373
|
+
'no-bitwise': 'error',
|
|
374
|
+
'no-lonely-if': 'error',
|
|
375
|
+
'no-mixed-operators': 'error',
|
|
376
|
+
'no-mixed-spaces-and-tabs': 'error',
|
|
377
|
+
'no-multi-assign': 'error',
|
|
378
|
+
'no-multiple-empty-lines': [
|
|
379
|
+
'error',
|
|
380
|
+
{
|
|
381
|
+
max: 1
|
|
382
|
+
}
|
|
383
|
+
],
|
|
384
|
+
'no-negated-condition': 'error',
|
|
385
|
+
'no-new-object': 'error',
|
|
386
|
+
'no-whitespace-before-property': 'error',
|
|
387
|
+
'no-trailing-spaces': 'error',
|
|
388
|
+
'no-unneeded-ternary': 'error',
|
|
389
|
+
'object-curly-spacing': [
|
|
390
|
+
'error',
|
|
391
|
+
'never'
|
|
392
|
+
],
|
|
393
|
+
// Disabled because of https://github.com/xojs/eslint-config-xo/issues/27
|
|
394
|
+
// 'object-property-newline': 'error',
|
|
395
|
+
'one-var': [
|
|
396
|
+
'error',
|
|
397
|
+
'never'
|
|
398
|
+
],
|
|
399
|
+
'one-var-declaration-per-line': 'error',
|
|
400
|
+
'operator-assignment': [
|
|
401
|
+
'error',
|
|
402
|
+
'always'
|
|
403
|
+
],
|
|
404
|
+
'operator-linebreak': [
|
|
405
|
+
'error',
|
|
406
|
+
'before'
|
|
407
|
+
],
|
|
408
|
+
'padded-blocks': [
|
|
409
|
+
'error',
|
|
410
|
+
'never',
|
|
411
|
+
{
|
|
412
|
+
allowSingleLineBlocks: false
|
|
413
|
+
}
|
|
414
|
+
],
|
|
415
|
+
'padding-line-between-statements': [
|
|
416
|
+
'error',
|
|
417
|
+
{
|
|
418
|
+
blankLine: 'always',
|
|
419
|
+
prev: 'multiline-block-like',
|
|
420
|
+
next: '*'
|
|
421
|
+
}
|
|
422
|
+
],
|
|
423
|
+
'prefer-exponentiation-operator': 'error',
|
|
424
|
+
'prefer-object-spread': 'error',
|
|
425
|
+
'quote-props': [
|
|
426
|
+
'error',
|
|
427
|
+
'as-needed'
|
|
428
|
+
],
|
|
429
|
+
quotes: [
|
|
430
|
+
'error',
|
|
431
|
+
'single'
|
|
432
|
+
],
|
|
433
|
+
'semi-spacing': [
|
|
434
|
+
'error',
|
|
435
|
+
{
|
|
436
|
+
before: false,
|
|
437
|
+
after: true
|
|
438
|
+
}
|
|
439
|
+
],
|
|
440
|
+
'semi-style': [
|
|
441
|
+
'error',
|
|
442
|
+
'last'
|
|
443
|
+
],
|
|
444
|
+
semi: [
|
|
445
|
+
'error',
|
|
446
|
+
'always'
|
|
447
|
+
],
|
|
448
|
+
'space-before-blocks': [
|
|
449
|
+
'error',
|
|
450
|
+
'always'
|
|
451
|
+
],
|
|
452
|
+
'space-before-function-paren': [
|
|
453
|
+
'error',
|
|
454
|
+
{
|
|
455
|
+
anonymous: 'always',
|
|
456
|
+
named: 'never',
|
|
457
|
+
asyncArrow: 'always'
|
|
458
|
+
}
|
|
459
|
+
],
|
|
460
|
+
'space-in-parens': [
|
|
461
|
+
'error',
|
|
462
|
+
'never'
|
|
463
|
+
],
|
|
464
|
+
'space-infix-ops': 'error',
|
|
465
|
+
'space-unary-ops': 'error',
|
|
466
|
+
'spaced-comment': [
|
|
467
|
+
'error',
|
|
468
|
+
'always',
|
|
469
|
+
{
|
|
470
|
+
line: {
|
|
471
|
+
exceptions: [
|
|
472
|
+
'-',
|
|
473
|
+
'+',
|
|
474
|
+
'*'
|
|
475
|
+
],
|
|
476
|
+
markers: [
|
|
477
|
+
'!',
|
|
478
|
+
'/',
|
|
479
|
+
'=>'
|
|
480
|
+
]
|
|
481
|
+
},
|
|
482
|
+
block: {
|
|
483
|
+
exceptions: [
|
|
484
|
+
'-',
|
|
485
|
+
'+',
|
|
486
|
+
'*'
|
|
487
|
+
],
|
|
488
|
+
markers: [
|
|
489
|
+
'!',
|
|
490
|
+
'*'
|
|
491
|
+
],
|
|
492
|
+
balanced: true
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
],
|
|
496
|
+
'switch-colon-spacing': [
|
|
497
|
+
'error',
|
|
498
|
+
{
|
|
499
|
+
after: true,
|
|
500
|
+
before: false
|
|
501
|
+
}
|
|
502
|
+
],
|
|
503
|
+
'template-tag-spacing': [
|
|
504
|
+
'error',
|
|
505
|
+
'never'
|
|
506
|
+
],
|
|
507
|
+
'unicode-bom': [
|
|
508
|
+
'error',
|
|
509
|
+
'never'
|
|
510
|
+
],
|
|
511
|
+
'arrow-body-style': 'error',
|
|
512
|
+
'arrow-parens': [
|
|
513
|
+
'error',
|
|
514
|
+
'as-needed'
|
|
515
|
+
],
|
|
516
|
+
'arrow-spacing': [
|
|
517
|
+
'error',
|
|
518
|
+
{
|
|
519
|
+
before: true,
|
|
520
|
+
after: true
|
|
521
|
+
}
|
|
522
|
+
],
|
|
523
|
+
'constructor-super': 'error',
|
|
524
|
+
'generator-star-spacing': [
|
|
525
|
+
'error',
|
|
526
|
+
'both'
|
|
527
|
+
],
|
|
528
|
+
'no-class-assign': 'error',
|
|
529
|
+
'no-const-assign': 'error',
|
|
530
|
+
'no-dupe-class-members': 'error',
|
|
531
|
+
'no-new-symbol': 'error',
|
|
532
|
+
'no-this-before-super': 'error',
|
|
533
|
+
'no-useless-computed-key': [
|
|
534
|
+
'error',
|
|
535
|
+
{
|
|
536
|
+
enforceForClassMembers: true
|
|
537
|
+
}
|
|
538
|
+
],
|
|
539
|
+
'no-useless-constructor': 'error',
|
|
540
|
+
'no-useless-rename': 'error',
|
|
541
|
+
'no-var': 'error',
|
|
542
|
+
'object-shorthand': [
|
|
543
|
+
'error',
|
|
544
|
+
'always'
|
|
545
|
+
],
|
|
546
|
+
'prefer-arrow-callback': [
|
|
547
|
+
'error',
|
|
548
|
+
{
|
|
549
|
+
allowNamedFunctions: true
|
|
550
|
+
}
|
|
551
|
+
],
|
|
552
|
+
'prefer-const': [
|
|
553
|
+
'error',
|
|
554
|
+
{
|
|
555
|
+
destructuring: 'all'
|
|
556
|
+
}
|
|
557
|
+
],
|
|
558
|
+
'prefer-destructuring': [
|
|
559
|
+
'error',
|
|
560
|
+
{
|
|
561
|
+
// `array` is disabled because it forces destructuring on
|
|
562
|
+
// stupid stuff like `foo.bar = process.argv[2];`
|
|
563
|
+
// TODO: Open ESLint issue about this
|
|
564
|
+
VariableDeclarator: {
|
|
565
|
+
array: false,
|
|
566
|
+
object: true
|
|
567
|
+
},
|
|
568
|
+
AssignmentExpression: {
|
|
569
|
+
array: false,
|
|
570
|
+
|
|
571
|
+
// Disabled because object assignment destructuring requires parens wrapping:
|
|
572
|
+
// `let foo; ({foo} = object);`
|
|
573
|
+
object: false
|
|
574
|
+
}
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
enforceForRenamedProperties: false
|
|
578
|
+
}
|
|
579
|
+
],
|
|
580
|
+
'prefer-numeric-literals': 'error',
|
|
581
|
+
'prefer-rest-params': 'error',
|
|
582
|
+
'prefer-spread': 'error',
|
|
583
|
+
'require-yield': 'error',
|
|
584
|
+
'rest-spread-spacing': [
|
|
585
|
+
'error',
|
|
586
|
+
'never'
|
|
587
|
+
],
|
|
588
|
+
'symbol-description': 'error',
|
|
589
|
+
'template-curly-spacing': 'error',
|
|
590
|
+
'yield-star-spacing': [
|
|
591
|
+
'error',
|
|
592
|
+
'both'
|
|
593
|
+
]
|
|
594
|
+
}
|
|
595
|
+
};
|
package/license
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "eslint-config-xo",
|
|
3
|
+
"version": "0.39.0",
|
|
4
|
+
"description": "ESLint shareable config for XO",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "xojs/eslint-config-xo",
|
|
7
|
+
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Sindre Sorhus",
|
|
10
|
+
"email": "sindresorhus@gmail.com",
|
|
11
|
+
"url": "https://sindresorhus.com"
|
|
12
|
+
},
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=10"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"test": "ava"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"index.js",
|
|
21
|
+
"browser.js"
|
|
22
|
+
],
|
|
23
|
+
"keywords": [
|
|
24
|
+
"eslintconfig",
|
|
25
|
+
"xo",
|
|
26
|
+
"xoxo",
|
|
27
|
+
"hugs",
|
|
28
|
+
"kisses",
|
|
29
|
+
"happy",
|
|
30
|
+
"happiness",
|
|
31
|
+
"code",
|
|
32
|
+
"quality",
|
|
33
|
+
"style",
|
|
34
|
+
"lint",
|
|
35
|
+
"linter",
|
|
36
|
+
"jscs",
|
|
37
|
+
"jshint",
|
|
38
|
+
"jslint",
|
|
39
|
+
"eslint",
|
|
40
|
+
"validate",
|
|
41
|
+
"code style",
|
|
42
|
+
"standard",
|
|
43
|
+
"strict",
|
|
44
|
+
"check",
|
|
45
|
+
"checker",
|
|
46
|
+
"verify",
|
|
47
|
+
"enforce",
|
|
48
|
+
"hint",
|
|
49
|
+
"simple"
|
|
50
|
+
],
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"confusing-browser-globals": "1.0.10"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"ava": "^2.4.0",
|
|
56
|
+
"eslint": "^7.20.0",
|
|
57
|
+
"is-plain-obj": "^3.0.0",
|
|
58
|
+
"temp-write": "^4.0.0"
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"eslint": ">=7.20.0"
|
|
62
|
+
}
|
|
63
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# eslint-config-xo
|
|
2
|
+
|
|
3
|
+
> ESLint [shareable config](https://eslint.org/docs/developer-guide/shareable-configs.html) for [XO](https://github.com/xojs/xo)
|
|
4
|
+
|
|
5
|
+
This is for advanced users. [You probably want to use XO directly.](#use-the-xo-cli-instead)
|
|
6
|
+
|
|
7
|
+
See [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) for some additional useful rules.
|
|
8
|
+
|
|
9
|
+
**Use the [XO issue tracker](https://github.com/xojs/xo/issues) instead of this one.**
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
$ npm install --save-dev eslint-config-xo
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
Add some ESLint config to your `package.json`:
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"name": "my-awesome-project",
|
|
24
|
+
"eslintConfig": {
|
|
25
|
+
"extends": "xo"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Or to `.eslintrc`:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"extends": "xo"
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Supports parsing ES2015+, but doesn't enforce it by default.
|
|
39
|
+
|
|
40
|
+
This package also exposes [`xo/browser`](browser.js) if you're in the browser:
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"extends": "xo/browser"
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Use the XO CLI instead
|
|
49
|
+
|
|
50
|
+
XO is an ESLint wrapper with great defaults.
|
|
51
|
+
|
|
52
|
+
Here are some reason why you should use the [XO CLI](https://github.com/xojs/xo) instead of this config:
|
|
53
|
+
|
|
54
|
+
- XO comes bundled with this config.
|
|
55
|
+
- [Beautiful output.](https://github.com/sindresorhus/eslint-formatter-pretty)
|
|
56
|
+
- Bundles many useful plugins, like [`eslint-plugin-unicorn`](https://github.com/sindresorhus/eslint-plugin-unicorn), [`eslint-plugin-import`](https://github.com/benmosher/eslint-plugin-import), [`eslint-plugin-ava`](https://github.com/avajs/eslint-plugin-ava), and more.
|
|
57
|
+
- No need to specify file paths to lint. It will lint all JS files except [commonly ignored paths](https://github.com/xojs/xo#ignores).
|
|
58
|
+
- Super simple to add XO to a project with [`$ npm init xo`](https://github.com/xojs/create-xo).
|
|
59
|
+
- Specify `indent` and `semicolon` preferences easily without messing with the rule config.
|
|
60
|
+
- Config/rule overrides per files/globs.
|
|
61
|
+
- Can open all files with errors at the correct line in your editor. *(See the `--open` flag)*
|
|
62
|
+
- The [editor plugins](https://github.com/xojs/xo#editor-plugins) are IMHO better than the ESLint ones. *(Subjective)*
|
|
63
|
+
|
|
64
|
+
tl;dr You miss out on a lot by just using this config.
|
|
65
|
+
|
|
66
|
+
## Related
|
|
67
|
+
|
|
68
|
+
- [eslint-config-xo-space](https://github.com/xojs/eslint-config-xo-space) - ESLint shareable config for XO with 2-space indent
|
|
69
|
+
- [eslint-config-xo-react](https://github.com/xojs/eslint-config-xo-react) - ESLint shareable config for React to be used with this config
|
|
70
|
+
- [eslint-config-xo-typescript](https://github.com/xojs/eslint-config-xo-typescript) - ESLint shareable config for TypeScript to be used with this config
|