@playcanvas/eslint-config 2.1.0 → 3.0.0-beta.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/eslint.config.mjs DELETED
@@ -1,550 +0,0 @@
1
- import jsdocPlugin from 'eslint-plugin-jsdoc';
2
- import importPlugin from 'eslint-plugin-import';
3
- import regexpPlugin from 'eslint-plugin-regexp';
4
-
5
- // ESM Script supported JSDoc tags
6
- const esmScriptTags = [
7
- 'attribute',
8
- 'resource',
9
- 'color',
10
- 'curves',
11
- 'range',
12
- 'placeholder',
13
- 'precision',
14
- 'size',
15
- 'step',
16
- 'title',
17
- 'visibleif',
18
- 'enabledif'
19
- ]
20
-
21
- export default [
22
- {
23
- plugins: {
24
- import: importPlugin,
25
- jsdoc: jsdocPlugin,
26
- regexp: regexpPlugin
27
- },
28
- rules: {
29
- // Possible Problems
30
- "array-callback-return": "error",
31
- "constructor-super": "error",
32
- "for-direction": "error",
33
- "getter-return": "error",
34
- "no-async-promise-executor": "error",
35
- "no-await-in-loop": "error",
36
- "no-class-assign": "error",
37
- "no-compare-neg-zero": "error",
38
- "no-cond-assign": "error",
39
- "no-const-assign": "error",
40
- "no-constant-binary-expression": "error",
41
- "no-constant-condition": [
42
- "error", {
43
- "checkLoops": false
44
- }
45
- ],
46
- "no-constructor-return": "error",
47
- "no-control-regex": "error",
48
- "no-debugger": "error",
49
- "no-dupe-args": "error",
50
- "no-dupe-class-members": "error",
51
- "no-dupe-else-if": "error",
52
- "no-dupe-keys": "error",
53
- "no-duplicate-case": "error",
54
- "no-duplicate-imports": "error",
55
- "no-empty-character-class": "error",
56
- "no-empty-pattern": "error",
57
- "no-ex-assign": "error",
58
- "no-fallthrough": "error",
59
- "no-func-assign": "error",
60
- "no-import-assign": "error",
61
- "no-inner-declarations": "error",
62
- "no-invalid-regexp": "error",
63
- "no-irregular-whitespace": "error",
64
- "no-loss-of-precision": "error",
65
- "no-misleading-character-class": "error",
66
- "no-new-native-nonconstructor": "error",
67
- "no-new-symbol": "error",
68
- "no-obj-calls": "error",
69
- "no-promise-executor-return": "error",
70
- "no-prototype-builtins": "off",
71
- "no-self-assign": "error",
72
- "no-self-compare": "error",
73
- "no-setter-return": "error",
74
- "no-sparse-arrays": "error",
75
- "no-template-curly-in-string": "error",
76
- "no-this-before-super": "error",
77
- "no-undef": "error",
78
- "no-unexpected-multiline": "error",
79
- "no-unmodified-loop-condition": "error",
80
- "no-unreachable": "error",
81
- "no-unreachable-loop": "error",
82
- "no-unsafe-finally": "error",
83
- "no-unsafe-negation": "error",
84
- "no-unsafe-optional-chaining": "error",
85
- "no-unused-private-class-members": "error",
86
- "no-unused-vars": [
87
- "error", {
88
- "args": "none",
89
- "caughtErrors": "none"
90
- }
91
- ],
92
- "no-use-before-define": [
93
- "error", {
94
- "functions": false
95
- }
96
- ],
97
- "no-useless-backreference": "error",
98
- "require-atomic-updates": "error",
99
- "use-isnan": "error",
100
- "valid-typeof": "error",
101
-
102
- // Suggestions
103
- "accessor-pairs": "error",
104
- "arrow-body-style": "off",
105
- "block-scoped-var": "error",
106
- "camelcase": "off",
107
- "capitalized-comments": "off",
108
- "class-methods-use-this": "off",
109
- "complexity": "off",
110
- "consistent-return": "off",
111
- "consistent-this": "off",
112
- "curly": ["error", "multi-line"],
113
- "default-case": "off",
114
- "default-case-last": "off",
115
- "default-param-last": "off",
116
- "dot-notation": "error",
117
- "eqeqeq": ["error", "smart"],
118
- "func-name-matching": "error",
119
- "func-names": "off",
120
- "func-style": "off",
121
- "grouped-accessor-pairs": ["error", "setBeforeGet"],
122
- "guard-for-in": "off",
123
- "id-denylist": "off",
124
- "id-length": "off",
125
- "id-match": "off",
126
- "init-declarations": "off",
127
- "logical-assignment-operators": "off",
128
- "max-classes-per-file": "off",
129
- "max-depth": "off",
130
- "max-lines": "off",
131
- "max-lines-per-function": "off",
132
- "max-nested-callbacks": "off",
133
- "max-params": "off",
134
- "max-statements": "off",
135
- "multiline-comment-style": ["warn", "separate-lines"],
136
- "new-cap": "off",
137
- "no-alert": "error",
138
- "no-array-constructor": "error",
139
- "no-bitwise": "off",
140
- "no-caller": "error",
141
- "no-case-declarations": "error",
142
- "no-confusing-arrow": "error",
143
- "no-console": "off",
144
- "no-continue": "off",
145
- "no-delete-var": "error",
146
- "no-div-regex": "error",
147
- "no-else-return": "error",
148
- "no-empty": [
149
- "error", {
150
- "allowEmptyCatch": true
151
- }
152
- ],
153
- "no-empty-function": "off",
154
- "no-empty-static-block": "error",
155
- "no-eq-null": "off",
156
- "no-eval": "error",
157
- "no-extend-native": "error",
158
- "no-extra-bind": "error",
159
- "no-extra-boolean-cast": "off",
160
- "no-extra-label": "error",
161
- "no-extra-semi": "error",
162
- "no-floating-decimal": "error",
163
- "no-global-assign": "error",
164
- "no-implicit-coercion": "off",
165
- "no-implicit-globals": "error",
166
- "no-implied-eval": "error",
167
- "no-inline-comments": "off",
168
- "no-invalid-this": "off",
169
- "no-iterator": "error",
170
- "no-label-var": "error",
171
- "no-labels": "error",
172
- "no-lone-blocks": "error",
173
- "no-lonely-if": "off",
174
- "no-loop-func": "error",
175
- "no-magic-numbers": "off",
176
- "no-mixed-operators": "off",
177
- "no-multi-assign": "off",
178
- "no-multi-str": "error",
179
- "no-negated-condition": "off",
180
- "no-nested-ternary": "off",
181
- "no-new": "warn",
182
- "no-new-func": "error",
183
- "no-new-object": "error",
184
- "no-new-wrappers": "error",
185
- "no-nonoctal-decimal-escape": "error",
186
- "no-octal": "error",
187
- "no-octal-escape": "error",
188
- "no-param-reassign": "off",
189
- "no-plusplus": "off",
190
- "no-proto": "error",
191
- "no-redeclare": "error",
192
- "no-regex-spaces": "error",
193
- "no-restricted-exports": "error",
194
- "no-restricted-globals": "off",
195
- "no-restricted-imports": "error",
196
- "no-restricted-properties": "off",
197
- "no-restricted-syntax": "error",
198
- "no-return-assign": "error",
199
- "no-script-url": "error",
200
- "no-sequences": "error",
201
- "no-shadow": "off",
202
- "no-shadow-restricted-names": "error",
203
- "no-ternary": "off",
204
- "no-throw-literal": "error",
205
- "no-undef-init": "error",
206
- "no-undefined": "off",
207
- "no-underscore-dangle": "off",
208
- "no-unneeded-ternary": "error",
209
- "no-unused-expressions": "error",
210
- "no-unused-labels": "error",
211
- "no-useless-call": "error",
212
- "no-useless-catch": "error",
213
- "no-useless-computed-key": "error",
214
- "no-useless-concat": "error",
215
- "no-useless-constructor": "error",
216
- "no-useless-escape": "off",
217
- "no-useless-rename": "error",
218
- "no-useless-return": "error",
219
- "no-var": "error",
220
- "no-void": "error",
221
- "no-warning-comments": "off",
222
- "no-with": "error",
223
- "object-shorthand": "off",
224
- "one-var": "off",
225
- "one-var-declaration-per-line": "off",
226
- "operator-assignment": ["error", "always"],
227
- "prefer-arrow-callback": "error",
228
- "prefer-const": "error",
229
- "prefer-destructuring": "off",
230
- "prefer-exponentiation-operator": "off",
231
- "prefer-named-capture-group": "off",
232
- "prefer-numeric-literals": "error",
233
- "prefer-object-has-own": "off",
234
- "prefer-object-spread": "off",
235
- "prefer-promise-reject-errors": "error",
236
- "prefer-regex-literals": "off",
237
- "prefer-rest-params": "off",
238
- "prefer-spread": "warn",
239
- "prefer-template": "error",
240
- "quote-props": "off",
241
- "radix": "error",
242
- "require-await": "error",
243
- "require-unicode-regexp": "off",
244
- "require-yield": "error",
245
- "sort-imports": "off",
246
- "sort-keys": "off",
247
- "sort-vars": "off",
248
- "spaced-comment": [
249
- "error", "always", {
250
- "exceptions": ["/"]
251
- }
252
- ],
253
- "strict": "error",
254
- "symbol-description": "error",
255
- "vars-on-top": "off",
256
- "yoda": "error",
257
-
258
- // Layout & Formatting
259
- "array-bracket-newline": ["error", "consistent"],
260
- "array-bracket-spacing": ["error", "never"],
261
- "array-element-newline": "off",
262
- "arrow-parens": [
263
- "error", "as-needed", {
264
- "requireForBlockBody": true
265
- }
266
- ],
267
- "arrow-spacing": "error",
268
- "block-spacing": "error",
269
- "brace-style": "error",
270
- "comma-dangle": ["error", "never"],
271
- "comma-spacing": [
272
- "error", {
273
- "before": false,
274
- "after": true
275
- }
276
- ],
277
- "comma-style": ["error", "last"],
278
- "computed-property-spacing": ["error", "never"],
279
- "dot-location": ["error", "property"],
280
- "eol-last": ["error", "always"],
281
- "func-call-spacing": ["error", "never"],
282
- "function-call-argument-newline": "off",
283
- "function-paren-newline": "off",
284
- "generator-star-spacing": "error",
285
- "implicit-arrow-linebreak": "error",
286
- "indent": ["error", 4, {
287
- "MemberExpression": 0,
288
- "SwitchCase": 1
289
- }],
290
- "jsx-quotes": "off",
291
- "key-spacing": [
292
- "error", {
293
- "beforeColon": false,
294
- "afterColon": true
295
- }
296
- ],
297
- "keyword-spacing": [
298
- "error", {
299
- "before": true,
300
- "after": true
301
- }
302
- ],
303
- "line-comment-position": "off",
304
- "linebreak-style": "off",
305
- "lines-around-comment": "off",
306
- "lines-between-class-members": ["error", "always"],
307
- "max-len": "off",
308
- "max-statements-per-line": "off",
309
- "multiline-ternary": "off",
310
- "new-parens": "error",
311
- "newline-per-chained-call": "off",
312
- "no-extra-parens": ["error", "functions"],
313
- "no-mixed-spaces-and-tabs": "error",
314
- "no-multi-spaces": [
315
- "error", {
316
- "ignoreEOLComments": true,
317
- "exceptions": {
318
- "ArrayExpression": true,
319
- "AssignmentExpression": true,
320
- "BinaryExpression": true,
321
- "IfStatement": true,
322
- "LogicalExpression": true,
323
- "SwitchCase": true,
324
- "VariableDeclarator": true
325
- }
326
- }
327
- ],
328
- "no-multiple-empty-lines": [
329
- "error", {
330
- "max": 2,
331
- "maxBOF": 0,
332
- "maxEOF": 0
333
- }
334
- ],
335
- "no-tabs": "error",
336
- "no-trailing-spaces": "error",
337
- "no-whitespace-before-property": "error",
338
- "nonblock-statement-body-position": "off",
339
- "object-curly-newline": [
340
- "error", {
341
- "consistent": true
342
- }
343
- ],
344
- "object-curly-spacing": ["error", "always"],
345
- "object-property-newline": [
346
- "error", {
347
- "allowAllPropertiesOnSameLine": true
348
- }
349
- ],
350
- "operator-linebreak": ["error", "after"],
351
- "padded-blocks": [
352
- "error", {
353
- "classes": "never"
354
- }
355
- ],
356
- "padding-line-between-statements": "off",
357
- "quotes": ["error", "single"],
358
- "rest-spread-spacing": "error",
359
- "semi": ["error", "always"],
360
- "semi-spacing": [
361
- "error", {
362
- "before": false,
363
- "after": true
364
- }
365
- ],
366
- "semi-style": ["error", "last"],
367
- "space-before-blocks": "error",
368
- "space-before-function-paren": [
369
- "error", {
370
- "anonymous": "always",
371
- "named": "never"
372
- }
373
- ],
374
- "space-in-parens": ["error", "never"],
375
- "space-infix-ops": [
376
- "error", {
377
- "int32Hint": false
378
- }
379
- ],
380
- "space-unary-ops": [
381
- "error", {
382
- "words": true,
383
- "nonwords": false,
384
- "overrides": {
385
- }
386
- }],
387
- "switch-colon-spacing": [
388
- "error", {
389
- "after": true,
390
- "before": false
391
- }
392
- ],
393
- "template-curly-spacing": "error",
394
- "template-tag-spacing": "error",
395
- "unicode-bom": ["error", "never"],
396
- "wrap-iife": "off",
397
- "wrap-regex": "off",
398
- "yield-star-spacing": "error",
399
-
400
- // Import rules
401
-
402
- // Static analysis
403
- "import/default": "error",
404
- "import/named": "error",
405
- "import/namespace": "error",
406
- "import/no-unresolved": "error",
407
- "import/order": ["error", {
408
- "groups": ["builtin", "external", "internal", ["parent", "sibling"], "index", "unknown"],
409
- "newlines-between": "always",
410
- "alphabetize": { "order": "asc", "caseInsensitive": true }
411
- }],
412
-
413
- // Helpful warnings
414
- "import/export": "error",
415
- "import/no-named-as-default": "warn",
416
- "import/no-named-as-default-member": "warn",
417
-
418
- // Style guide
419
- "import/extensions": ["error", "ignorePackages", { "ts": "never", "tsx": "never" }],
420
- "import/no-duplicates": "warn",
421
-
422
- // JSDoc rules
423
- "jsdoc/check-access": "error",
424
- "jsdoc/check-alignment": "error",
425
- "jsdoc/check-examples": "off",
426
- "jsdoc/check-indentation": "off",
427
- "jsdoc/check-line-alignment": "error",
428
- "jsdoc/check-param-names": "off",
429
- "jsdoc/check-property-names": "error",
430
- "jsdoc/check-syntax": "error",
431
- "jsdoc/check-tag-names": ["error", { "definedTags": [...esmScriptTags, "alpha", "beta", "category", "import"] }],
432
- "jsdoc/check-types": "off",
433
- "jsdoc/check-values": "error",
434
- "jsdoc/empty-tags": "error",
435
- "jsdoc/implements-on-classes": "error",
436
- "jsdoc/informative-docs": "off",
437
- "jsdoc/match-description": "off",
438
- "jsdoc/match-name": "off",
439
- "jsdoc/multiline-blocks": "error",
440
- "jsdoc/no-bad-blocks": "error",
441
- "jsdoc/no-blank-block-descriptions": "error",
442
- "jsdoc/no-blank-blocks": "error",
443
- "jsdoc/no-defaults": "error",
444
- "jsdoc/no-missing-syntax": "off",
445
- "jsdoc/no-multi-asterisks": "error",
446
- "jsdoc/no-restricted-syntax": "off",
447
- "jsdoc/no-types": "off",
448
- "jsdoc/no-undefined-types": "off",
449
- "jsdoc/require-asterisk-prefix": "error",
450
- "jsdoc/require-description": "off",
451
- "jsdoc/require-description-complete-sentence": [
452
- "off", {
453
- "abbreviations": ["e.g."]
454
- }
455
- ],
456
- "jsdoc/require-example": "off",
457
- "jsdoc/require-file-overview": "off",
458
- "jsdoc/require-hyphen-before-param-description": ["error", "always"],
459
- "jsdoc/require-jsdoc": "off",
460
- "jsdoc/require-param": "error",
461
- "jsdoc/require-param-description": "error",
462
- "jsdoc/require-param-name": "error",
463
- "jsdoc/require-param-type": "error",
464
- "jsdoc/require-property": "error",
465
- "jsdoc/require-property-description": "error",
466
- "jsdoc/require-property-name": "error",
467
- "jsdoc/require-property-type": "error",
468
- "jsdoc/require-returns": "error",
469
- "jsdoc/require-returns-check": "error",
470
- "jsdoc/require-returns-description": "error",
471
- "jsdoc/require-returns-type": "error",
472
- "jsdoc/require-throws": "off",
473
- "jsdoc/require-yields": "error",
474
- "jsdoc/require-yields-check": "error",
475
- "jsdoc/sort-tags": "off",
476
- "jsdoc/tag-lines": "off",
477
- "jsdoc/text-escaping": "off",
478
- "jsdoc/valid-types": "off",
479
-
480
- // Regex rules
481
- "no-control-regex": "error",
482
- "no-misleading-character-class": "error",
483
- "no-regex-spaces": "error",
484
- "prefer-regex-literals": "error",
485
- "no-invalid-regexp": "off",
486
- "no-useless-backreference": "off",
487
- "no-empty-character-class": "off",
488
- "regexp/confusing-quantifier": "warn",
489
- "regexp/control-character-escape": "error",
490
- "regexp/match-any": "error",
491
- "regexp/negation": "error",
492
- "regexp/no-contradiction-with-assertion": "error",
493
- "regexp/no-dupe-characters-character-class": "error",
494
- "regexp/no-dupe-disjunctions": "error",
495
- "regexp/no-empty-alternative": "warn",
496
- "regexp/no-empty-capturing-group": "error",
497
- "regexp/no-empty-character-class": "error",
498
- "regexp/no-empty-group": "error",
499
- "regexp/no-empty-lookarounds-assertion": "error",
500
- "regexp/no-empty-string-literal": "error",
501
- "regexp/no-escape-backspace": "error",
502
- "regexp/no-extra-lookaround-assertions": "error",
503
- "regexp/no-invalid-regexp": "error",
504
- "regexp/no-invisible-character": "error",
505
- "regexp/no-lazy-ends": "warn",
506
- "regexp/no-legacy-features": "error",
507
- "regexp/no-misleading-capturing-group": "error",
508
- "regexp/no-misleading-unicode-character": "error",
509
- "regexp/no-missing-g-flag": "error",
510
- "regexp/no-non-standard-flag": "error",
511
- "regexp/no-obscure-range": "error",
512
- "regexp/no-optional-assertion": "error",
513
- "regexp/no-potentially-useless-backreference": "warn",
514
- "regexp/no-super-linear-backtracking": "error",
515
- "regexp/no-trivially-nested-assertion": "error",
516
- "regexp/no-trivially-nested-quantifier": "error",
517
- "regexp/no-unused-capturing-group": "error",
518
- "regexp/no-useless-assertions": "error",
519
- "regexp/no-useless-backreference": "error",
520
- "regexp/no-useless-character-class": "error",
521
- "regexp/no-useless-dollar-replacements": "error",
522
- "regexp/no-useless-escape": "error",
523
- "regexp/no-useless-flag": "warn",
524
- "regexp/no-useless-lazy": "error",
525
- "regexp/no-useless-non-capturing-group": "error",
526
- "regexp/no-useless-quantifier": "error",
527
- "regexp/no-useless-range": "error",
528
- "regexp/no-useless-set-operand": "error",
529
- "regexp/no-useless-string-literal": "error",
530
- "regexp/no-useless-two-nums-quantifier": "error",
531
- "regexp/no-zero-quantifier": "error",
532
- "regexp/optimal-lookaround-quantifier": "warn",
533
- "regexp/optimal-quantifier-concatenation": "error",
534
- "regexp/prefer-character-class": "error",
535
- "regexp/prefer-d": "error",
536
- "regexp/prefer-plus-quantifier": "error",
537
- "regexp/prefer-predefined-assertion": "error",
538
- "regexp/prefer-question-quantifier": "error",
539
- "regexp/prefer-range": "error",
540
- "regexp/prefer-set-operation": "error",
541
- "regexp/prefer-star-quantifier": "error",
542
- "regexp/prefer-unicode-codepoint-escapes": "error",
543
- "regexp/prefer-w": "error",
544
- "regexp/simplify-set-operations": "error",
545
- "regexp/sort-flags": "error",
546
- "regexp/strict": "error",
547
- "regexp/use-ignore-case": "error",
548
- }
549
- }
550
- ];