@playcanvas/eslint-config 1.7.1 → 1.7.2

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 (4) hide show
  1. package/LICENSE +19 -19
  2. package/README.md +25 -25
  3. package/index.js +555 -480
  4. package/package.json +39 -38
package/LICENSE CHANGED
@@ -1,19 +1,19 @@
1
- Copyright (c) 2011-2021 PlayCanvas Ltd.
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in
11
- all copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
1
+ Copyright (c) 2011-2021 PlayCanvas Ltd.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
package/README.md CHANGED
@@ -1,25 +1,25 @@
1
- # PlayCanvas ESLint Config
2
-
3
- ESLint configuration developed by the PlayCanvas team and leveraged by many PlayCanvas-related projects, including the [PlayCanvas Engine][engine]. However, you can use it for any JavaScript-based project if you approve of the PlayCanvas coding style.
4
-
5
- The configuration is defined in [`index.js`][index]. It configures ESLint's rules in the same order as they are enumerated [here][rules]. It also configures rules for checking JSDoc comments using the ESLint plugin [`eslint-plugin-jsdoc-rules`][jsdoc-plugin].
6
-
7
- The configuration attempts to enable as many rules as possible, particularly those categorized as 'recommended' by ESLint.
8
-
9
- ## Using this config in your own projects
10
-
11
- Edit your project's `package.json` file:
12
-
13
- 1. Add `eslint` and `@playcanvas/eslint-config` to your `devDependencies` section.
14
- 2. Add an `eslintConfig` section. At a minimum, you will need:
15
-
16
- ```json
17
- "eslintConfig": {
18
- "extends": "@playcanvas/eslint-config"
19
- },
20
- ```
21
-
22
- [engine]: https://github.com/playcanvas/engine
23
- [index]: https://github.com/playcanvas/playcanvas-eslint-config/blob/master/index.js
24
- [rules]: https://eslint.org/docs/rules/
25
- [jsdoc-plugin]: https://github.com/gajus/eslint-plugin-jsdoc
1
+ # PlayCanvas ESLint Config
2
+
3
+ ESLint configuration developed by the PlayCanvas team and leveraged by many PlayCanvas-related projects, including the [PlayCanvas Engine][engine]. However, you can use it for any JavaScript-based project if you approve of the PlayCanvas coding style.
4
+
5
+ The configuration is defined in [`index.js`][index]. It configures ESLint's rules in the same order as they are enumerated [here][rules]. It also configures rules for checking JSDoc comments using the ESLint plugin [`eslint-plugin-jsdoc-rules`][jsdoc-plugin].
6
+
7
+ The configuration attempts to enable as many rules as possible, particularly those categorized as 'recommended' by ESLint.
8
+
9
+ ## Using this config in your own projects
10
+
11
+ Edit your project's `package.json` file:
12
+
13
+ 1. Add `eslint` and `@playcanvas/eslint-config` to your `devDependencies` section.
14
+ 2. Add an `eslintConfig` section. At a minimum, you will need:
15
+
16
+ ```json
17
+ "eslintConfig": {
18
+ "extends": "@playcanvas/eslint-config"
19
+ },
20
+ ```
21
+
22
+ [engine]: https://github.com/playcanvas/engine
23
+ [index]: https://github.com/playcanvas/playcanvas-eslint-config/blob/master/index.js
24
+ [rules]: https://eslint.org/docs/rules/
25
+ [jsdoc-plugin]: https://github.com/gajus/eslint-plugin-jsdoc
package/index.js CHANGED
@@ -1,480 +1,555 @@
1
- module.exports = {
2
-
3
- "parserOptions": {
4
- "ecmaVersion": 2022,
5
- "sourceType": "module",
6
- "ecmaFeatures": {}
7
- },
8
-
9
- // Rules reference: https://eslint.org/docs/rules/
10
- "rules": {
11
- // Possible Problems
12
- "array-callback-return": "error",
13
- "constructor-super": "error",
14
- "for-direction": "error",
15
- "getter-return": "error",
16
- "no-async-promise-executor": "error",
17
- "no-await-in-loop": "error",
18
- "no-class-assign": "error",
19
- "no-compare-neg-zero": "error",
20
- "no-cond-assign": "error",
21
- "no-const-assign": "error",
22
- "no-constant-binary-expression": "error",
23
- "no-constant-condition": [
24
- "error", {
25
- "checkLoops": false
26
- }
27
- ],
28
- "no-constructor-return": "error",
29
- "no-control-regex": "error",
30
- "no-debugger": "error",
31
- "no-dupe-args": "error",
32
- "no-dupe-class-members": "error",
33
- "no-dupe-else-if": "error",
34
- "no-dupe-keys": "error",
35
- "no-duplicate-case": "error",
36
- "no-duplicate-imports": "error",
37
- "no-empty-character-class": "error",
38
- "no-empty-pattern": "error",
39
- "no-ex-assign": "error",
40
- "no-fallthrough": "error",
41
- "no-func-assign": "error",
42
- "no-import-assign": "error",
43
- "no-inner-declarations": "error",
44
- "no-invalid-regexp": "error",
45
- "no-irregular-whitespace": "error",
46
- "no-loss-of-precision": "error",
47
- "no-misleading-character-class": "error",
48
- "no-new-native-nonconstructor": "error",
49
- "no-new-symbol": "error",
50
- "no-obj-calls": "error",
51
- "no-promise-executor-return": "error",
52
- "no-prototype-builtins": "off",
53
- "no-self-assign": "error",
54
- "no-self-compare": "error",
55
- "no-setter-return": "error",
56
- "no-sparse-arrays": "error",
57
- "no-template-curly-in-string": "error",
58
- "no-this-before-super": "error",
59
- "no-undef": "error",
60
- "no-unexpected-multiline": "error",
61
- "no-unmodified-loop-condition": "error",
62
- "no-unreachable": "error",
63
- "no-unreachable-loop": "error",
64
- "no-unsafe-finally": "error",
65
- "no-unsafe-negation": "error",
66
- "no-unsafe-optional-chaining": "error",
67
- "no-unused-private-class-members": "error",
68
- "no-unused-vars": [
69
- "error", {
70
- "args": "none"
71
- }
72
- ],
73
- "no-use-before-define": [
74
- "error", {
75
- "functions": false
76
- }
77
- ],
78
- "no-useless-backreference": "error",
79
- "require-atomic-updates": "error",
80
- "use-isnan": "error",
81
- "valid-typeof": "error",
82
-
83
- // Suggestions
84
- "accessor-pairs": "error",
85
- "arrow-body-style": "off",
86
- "block-scoped-var": "error",
87
- "camelcase": "off",
88
- "capitalized-comments": "off",
89
- "class-methods-use-this": "off",
90
- "complexity": "off",
91
- "consistent-return": "off",
92
- "consistent-this": "off",
93
- "curly": "off",
94
- "default-case": "off",
95
- "default-case-last": "off",
96
- "default-param-last": "off",
97
- "dot-notation": "error",
98
- "eqeqeq": ["error", "smart"],
99
- "func-name-matching": "error",
100
- "func-names": "off",
101
- "func-style": "off",
102
- "grouped-accessor-pairs": ["error", "setBeforeGet"],
103
- "guard-for-in": "off",
104
- "id-denylist": "off",
105
- "id-length": "off",
106
- "id-match": "off",
107
- "init-declarations": "off",
108
- "logical-assignment-operators": "off",
109
- "max-classes-per-file": "off",
110
- "max-depth": "off",
111
- "max-lines": "off",
112
- "max-lines-per-function": "off",
113
- "max-nested-callbacks": "off",
114
- "max-params": "off",
115
- "max-statements": "off",
116
- "multiline-comment-style": ["warn", "separate-lines"],
117
- "new-cap": "off",
118
- "no-alert": "error",
119
- "no-array-constructor": "error",
120
- "no-bitwise": "off",
121
- "no-caller": "error",
122
- "no-case-declarations": "error",
123
- "no-confusing-arrow": "error",
124
- "no-console": "off",
125
- "no-continue": "off",
126
- "no-delete-var": "error",
127
- "no-div-regex": "error",
128
- "no-else-return": "error",
129
- "no-empty": [
130
- "error", {
131
- "allowEmptyCatch": true
132
- }
133
- ],
134
- "no-empty-function": "off",
135
- "no-empty-static-block": "error",
136
- "no-eq-null": "off",
137
- "no-eval": "error",
138
- "no-extend-native": "error",
139
- "no-extra-bind": "error",
140
- "no-extra-boolean-cast": "off",
141
- "no-extra-label": "error",
142
- "no-extra-semi": "error",
143
- "no-floating-decimal": "error",
144
- "no-global-assign": "error",
145
- "no-implicit-coercion": "off",
146
- "no-implicit-globals": "error",
147
- "no-implied-eval": "error",
148
- "no-inline-comments": "off",
149
- "no-invalid-this": "off",
150
- "no-iterator": "error",
151
- "no-label-var": "error",
152
- "no-labels": "error",
153
- "no-lone-blocks": "error",
154
- "no-lonely-if": "off",
155
- "no-loop-func": "error",
156
- "no-magic-numbers": "off",
157
- "no-mixed-operators": "off",
158
- "no-multi-assign": "off",
159
- "no-multi-str": "error",
160
- "no-negated-condition": "off",
161
- "no-nested-ternary": "off",
162
- "no-new": "warn",
163
- "no-new-func": "error",
164
- "no-new-object": "error",
165
- "no-new-wrappers": "error",
166
- "no-nonoctal-decimal-escape": "error",
167
- "no-octal": "error",
168
- "no-octal-escape": "error",
169
- "no-param-reassign": "off",
170
- "no-plusplus": "off",
171
- "no-proto": "error",
172
- "no-redeclare": "error",
173
- "no-regex-spaces": "error",
174
- "no-restricted-exports": "error",
175
- "no-restricted-globals": "off",
176
- "no-restricted-imports": "error",
177
- "no-restricted-properties": "off",
178
- "no-restricted-syntax": "error",
179
- "no-return-assign": "error",
180
- "no-script-url": "error",
181
- "no-sequences": "error",
182
- "no-shadow": "off",
183
- "no-shadow-restricted-names": "error",
184
- "no-ternary": "off",
185
- "no-throw-literal": "error",
186
- "no-undef-init": "error",
187
- "no-undefined": "off",
188
- "no-underscore-dangle": "off",
189
- "no-unneeded-ternary": "error",
190
- "no-unused-expressions": "error",
191
- "no-unused-labels": "error",
192
- "no-useless-call": "error",
193
- "no-useless-catch": "error",
194
- "no-useless-computed-key": "error",
195
- "no-useless-concat": "error",
196
- "no-useless-constructor": "error",
197
- "no-useless-escape": "off",
198
- "no-useless-rename": "error",
199
- "no-useless-return": "error",
200
- "no-var": "off", // update to error
201
- "no-void": "error",
202
- "no-warning-comments": "off",
203
- "no-with": "error",
204
- "object-shorthand": "off",
205
- "one-var": "off",
206
- "one-var-declaration-per-line": "off",
207
- "operator-assignment": ["error", "always"],
208
- "prefer-arrow-callback": "off",
209
- "prefer-const": "error",
210
- "prefer-destructuring": "off",
211
- "prefer-exponentiation-operator": "off",
212
- "prefer-named-capture-group": "off",
213
- "prefer-numeric-literals": "error",
214
- "prefer-object-has-own": "off",
215
- "prefer-object-spread": "off",
216
- "prefer-promise-reject-errors": "error",
217
- "prefer-regex-literals": "off",
218
- "prefer-rest-params": "off",
219
- "prefer-spread": "warn",
220
- "prefer-template": "off",
221
- "quote-props": "off",
222
- "radix": "error",
223
- "require-await": "error",
224
- "require-unicode-regexp": "off",
225
- "require-yield": "error",
226
- "sort-imports": "off",
227
- "sort-keys": "off",
228
- "sort-vars": "off",
229
- "spaced-comment": [
230
- "error", "always", {
231
- "exceptions": ["/"]
232
- }
233
- ],
234
- "strict": "error",
235
- "symbol-description": "error",
236
- "vars-on-top": "off",
237
- "yoda": "error",
238
-
239
- // Layout & Formatting
240
- "array-bracket-newline": ["error", "consistent"],
241
- "array-bracket-spacing": ["error", "never"],
242
- "array-element-newline": "off",
243
- "arrow-parens": [
244
- "error", "as-needed", {
245
- "requireForBlockBody": true
246
- }
247
- ],
248
- "arrow-spacing": "error",
249
- "block-spacing": "error",
250
- "brace-style": "error",
251
- "comma-dangle": ["error", "never"],
252
- "comma-spacing": [
253
- "error", {
254
- "before": false,
255
- "after": true
256
- }
257
- ],
258
- "comma-style": ["error", "last"],
259
- "computed-property-spacing": ["error", "never"],
260
- "dot-location": ["error", "property"],
261
- "eol-last": ["error", "always"],
262
- "func-call-spacing": ["error", "never"],
263
- "function-call-argument-newline": "off",
264
- "function-paren-newline": "off",
265
- "generator-star-spacing": "error",
266
- "implicit-arrow-linebreak": "error",
267
- "indent": [
268
- "error", 4, {
269
- "SwitchCase": 1,
270
- "CallExpression": {
271
- "arguments": "first"
272
- },
273
- "ignoreComments": true
274
- }
275
- ],
276
- "jsx-quotes": "off",
277
- "key-spacing": [
278
- "error", {
279
- "beforeColon": false,
280
- "afterColon": true
281
- }
282
- ],
283
- "keyword-spacing": [
284
- "error", {
285
- "before": true,
286
- "after": true
287
- }
288
- ],
289
- "line-comment-position": "off",
290
- "linebreak-style": "off",
291
- "lines-around-comment": "off",
292
- "lines-between-class-members": ["error", "always"],
293
- "max-len": "off",
294
- "max-statements-per-line": "off",
295
- "multiline-ternary": "off",
296
- "new-parens": "error",
297
- "newline-per-chained-call": "off",
298
- "no-extra-parens": ["error", "functions"],
299
- "no-mixed-spaces-and-tabs": "error",
300
- "no-multi-spaces": [
301
- "error", {
302
- "ignoreEOLComments": true,
303
- "exceptions": {
304
- "ArrayExpression": true,
305
- "AssignmentExpression": true,
306
- "BinaryExpression": true,
307
- "IfStatement": true,
308
- "LogicalExpression": true,
309
- "SwitchCase": true,
310
- "VariableDeclarator": true
311
- }
312
- }
313
- ],
314
- "no-multiple-empty-lines": [
315
- "error", {
316
- "max": 2,
317
- "maxBOF": 0,
318
- "maxEOF": 0
319
- }
320
- ],
321
- "no-tabs": "error",
322
- "no-trailing-spaces": "error",
323
- "no-whitespace-before-property": "error",
324
- "nonblock-statement-body-position": "off",
325
- "object-curly-newline": [
326
- "error", {
327
- "consistent": true
328
- }
329
- ],
330
- "object-curly-spacing": ["error", "always"],
331
- "object-property-newline": [
332
- "error", {
333
- "allowAllPropertiesOnSameLine": true
334
- }
335
- ],
336
- "operator-linebreak": ["error", "after"],
337
- "padded-blocks": [
338
- "error", {
339
- "classes": "never"
340
- }
341
- ],
342
- "padding-line-between-statements": "off",
343
- "quotes": ["off", "single"],
344
- "rest-spread-spacing": "error",
345
- "semi": ["error", "always"],
346
- "semi-spacing": [
347
- "error", {
348
- "before": false,
349
- "after": true
350
- }
351
- ],
352
- "semi-style": ["error", "last"],
353
- "space-before-blocks": "error",
354
- "space-before-function-paren": [
355
- "error", {
356
- "anonymous": "always",
357
- "named": "never"
358
- }
359
- ],
360
- "space-in-parens": ["error", "never"],
361
- "space-infix-ops": [
362
- "error", {
363
- "int32Hint": false
364
- }
365
- ],
366
- "space-unary-ops": [
367
- "error", {
368
- "words": true,
369
- "nonwords": false,
370
- "overrides": {
371
- }
372
- }],
373
- "switch-colon-spacing": [
374
- "error", {
375
- "after": true,
376
- "before": false
377
- }
378
- ],
379
- "template-curly-spacing": "error",
380
- "template-tag-spacing": "error",
381
- "unicode-bom": ["error", "never"],
382
- "wrap-iife": "off",
383
- "wrap-regex": "off",
384
- "yield-star-spacing": "error",
385
-
386
- // Import rules
387
-
388
- // Static analysis
389
- "import/default": "error",
390
- "import/named": "error",
391
- "import/namespace": "error",
392
- "import/no-unresolved": "error",
393
-
394
- // Helpful warnings
395
- "import/export": "error",
396
- "import/no-named-as-default": "warn",
397
- "import/no-named-as-default-member": "warn",
398
-
399
- // Style guide
400
- "import/extensions": ["error", "always", { "ts": "never", "tsx": "never" }],
401
- "import/no-duplicates": "warn",
402
-
403
- // JSDoc rules
404
- "jsdoc/check-access": "error",
405
- "jsdoc/check-alignment": "error",
406
- "jsdoc/check-examples": "off",
407
- "jsdoc/check-indentation": "off",
408
- "jsdoc/check-line-alignment": "error",
409
- "jsdoc/check-param-names": "off",
410
- "jsdoc/check-property-names": "error",
411
- "jsdoc/check-syntax": "error",
412
- "jsdoc/check-tag-names": "error",
413
- "jsdoc/check-types": "off",
414
- "jsdoc/check-values": "error",
415
- "jsdoc/empty-tags": "error",
416
- "jsdoc/implements-on-classes": "error",
417
- "jsdoc/informative-docs": "off",
418
- "jsdoc/match-description": "off",
419
- "jsdoc/match-name": "off",
420
- "jsdoc/multiline-blocks": "error",
421
- "jsdoc/no-bad-blocks": "error",
422
- "jsdoc/no-blank-block-descriptions": "error",
423
- "jsdoc/no-blank-blocks": "error",
424
- "jsdoc/no-defaults": "error",
425
- "jsdoc/no-missing-syntax": "off",
426
- "jsdoc/no-multi-asterisks": "error",
427
- "jsdoc/no-restricted-syntax": "off",
428
- "jsdoc/no-types": "off",
429
- "jsdoc/no-undefined-types": "off",
430
- "jsdoc/require-asterisk-prefix": "error",
431
- "jsdoc/require-description": "off",
432
- "jsdoc/require-description-complete-sentence": [
433
- "off", {
434
- "abbreviations": ["e.g."]
435
- }
436
- ],
437
- "jsdoc/require-example": "off",
438
- "jsdoc/require-file-overview": "off",
439
- "jsdoc/require-hyphen-before-param-description": ["error", "always"],
440
- "jsdoc/require-jsdoc": "off",
441
- "jsdoc/require-param": "error",
442
- "jsdoc/require-param-description": "error",
443
- "jsdoc/require-param-name": "error",
444
- "jsdoc/require-param-type": "error",
445
- "jsdoc/require-property": "error",
446
- "jsdoc/require-property-description": "error",
447
- "jsdoc/require-property-name": "error",
448
- "jsdoc/require-property-type": "error",
449
- "jsdoc/require-returns": "error",
450
- "jsdoc/require-returns-check": "error",
451
- "jsdoc/require-returns-description": "error",
452
- "jsdoc/require-returns-type": "error",
453
- "jsdoc/require-throws": "off",
454
- "jsdoc/require-yields": "error",
455
- "jsdoc/require-yields-check": "error",
456
- "jsdoc/sort-tags": "off",
457
- "jsdoc/tag-lines": "off",
458
- "jsdoc/text-escaping": "off",
459
- "jsdoc/valid-types": "off"
460
- },
461
-
462
- "plugins": [
463
- "import",
464
- "jsdoc"
465
- ],
466
-
467
- "settings": {
468
- "jsdoc": {
469
- "mode": "typescript"
470
- }
471
- },
472
-
473
- "env": {
474
- "browser": true,
475
- "es2022": true,
476
- "node": true,
477
- "worker": true
478
- }
479
-
480
- };
1
+ module.exports = {
2
+
3
+ "parserOptions": {
4
+ "ecmaVersion": 2022,
5
+ "sourceType": "module",
6
+ "ecmaFeatures": {}
7
+ },
8
+
9
+ // Rules reference: https://eslint.org/docs/rules/
10
+ "rules": {
11
+ // Possible Problems
12
+ "array-callback-return": "error",
13
+ "constructor-super": "error",
14
+ "for-direction": "error",
15
+ "getter-return": "error",
16
+ "no-async-promise-executor": "error",
17
+ "no-await-in-loop": "error",
18
+ "no-class-assign": "error",
19
+ "no-compare-neg-zero": "error",
20
+ "no-cond-assign": "error",
21
+ "no-const-assign": "error",
22
+ "no-constant-binary-expression": "error",
23
+ "no-constant-condition": [
24
+ "error", {
25
+ "checkLoops": false
26
+ }
27
+ ],
28
+ "no-constructor-return": "error",
29
+ "no-control-regex": "error",
30
+ "no-debugger": "error",
31
+ "no-dupe-args": "error",
32
+ "no-dupe-class-members": "error",
33
+ "no-dupe-else-if": "error",
34
+ "no-dupe-keys": "error",
35
+ "no-duplicate-case": "error",
36
+ "no-duplicate-imports": "error",
37
+ "no-empty-character-class": "error",
38
+ "no-empty-pattern": "error",
39
+ "no-ex-assign": "error",
40
+ "no-fallthrough": "error",
41
+ "no-func-assign": "error",
42
+ "no-import-assign": "error",
43
+ "no-inner-declarations": "error",
44
+ "no-invalid-regexp": "error",
45
+ "no-irregular-whitespace": "error",
46
+ "no-loss-of-precision": "error",
47
+ "no-misleading-character-class": "error",
48
+ "no-new-native-nonconstructor": "error",
49
+ "no-new-symbol": "error",
50
+ "no-obj-calls": "error",
51
+ "no-promise-executor-return": "error",
52
+ "no-prototype-builtins": "off",
53
+ "no-self-assign": "error",
54
+ "no-self-compare": "error",
55
+ "no-setter-return": "error",
56
+ "no-sparse-arrays": "error",
57
+ "no-template-curly-in-string": "error",
58
+ "no-this-before-super": "error",
59
+ "no-undef": "error",
60
+ "no-unexpected-multiline": "error",
61
+ "no-unmodified-loop-condition": "error",
62
+ "no-unreachable": "error",
63
+ "no-unreachable-loop": "error",
64
+ "no-unsafe-finally": "error",
65
+ "no-unsafe-negation": "error",
66
+ "no-unsafe-optional-chaining": "error",
67
+ "no-unused-private-class-members": "error",
68
+ "no-unused-vars": [
69
+ "error", {
70
+ "args": "none"
71
+ }
72
+ ],
73
+ "no-use-before-define": [
74
+ "error", {
75
+ "functions": false
76
+ }
77
+ ],
78
+ "no-useless-backreference": "error",
79
+ "require-atomic-updates": "error",
80
+ "use-isnan": "error",
81
+ "valid-typeof": "error",
82
+
83
+ // Suggestions
84
+ "accessor-pairs": "error",
85
+ "arrow-body-style": "off",
86
+ "block-scoped-var": "error",
87
+ "camelcase": "off",
88
+ "capitalized-comments": "off",
89
+ "class-methods-use-this": "off",
90
+ "complexity": "off",
91
+ "consistent-return": "off",
92
+ "consistent-this": "off",
93
+ "curly": ["error", "multi-line"],
94
+ "default-case": "off",
95
+ "default-case-last": "off",
96
+ "default-param-last": "off",
97
+ "dot-notation": "error",
98
+ "eqeqeq": ["error", "smart"],
99
+ "func-name-matching": "error",
100
+ "func-names": "off",
101
+ "func-style": "off",
102
+ "grouped-accessor-pairs": ["error", "setBeforeGet"],
103
+ "guard-for-in": "off",
104
+ "id-denylist": "off",
105
+ "id-length": "off",
106
+ "id-match": "off",
107
+ "init-declarations": "off",
108
+ "logical-assignment-operators": "off",
109
+ "max-classes-per-file": "off",
110
+ "max-depth": "off",
111
+ "max-lines": "off",
112
+ "max-lines-per-function": "off",
113
+ "max-nested-callbacks": "off",
114
+ "max-params": "off",
115
+ "max-statements": "off",
116
+ "multiline-comment-style": ["warn", "separate-lines"],
117
+ "new-cap": "off",
118
+ "no-alert": "error",
119
+ "no-array-constructor": "error",
120
+ "no-bitwise": "off",
121
+ "no-caller": "error",
122
+ "no-case-declarations": "error",
123
+ "no-confusing-arrow": "error",
124
+ "no-console": "off",
125
+ "no-continue": "off",
126
+ "no-delete-var": "error",
127
+ "no-div-regex": "error",
128
+ "no-else-return": "error",
129
+ "no-empty": [
130
+ "error", {
131
+ "allowEmptyCatch": true
132
+ }
133
+ ],
134
+ "no-empty-function": "off",
135
+ "no-empty-static-block": "error",
136
+ "no-eq-null": "off",
137
+ "no-eval": "error",
138
+ "no-extend-native": "error",
139
+ "no-extra-bind": "error",
140
+ "no-extra-boolean-cast": "off",
141
+ "no-extra-label": "error",
142
+ "no-extra-semi": "error",
143
+ "no-floating-decimal": "error",
144
+ "no-global-assign": "error",
145
+ "no-implicit-coercion": "off",
146
+ "no-implicit-globals": "error",
147
+ "no-implied-eval": "error",
148
+ "no-inline-comments": "off",
149
+ "no-invalid-this": "off",
150
+ "no-iterator": "error",
151
+ "no-label-var": "error",
152
+ "no-labels": "error",
153
+ "no-lone-blocks": "error",
154
+ "no-lonely-if": "off",
155
+ "no-loop-func": "error",
156
+ "no-magic-numbers": "off",
157
+ "no-mixed-operators": "off",
158
+ "no-multi-assign": "off",
159
+ "no-multi-str": "error",
160
+ "no-negated-condition": "off",
161
+ "no-nested-ternary": "off",
162
+ "no-new": "warn",
163
+ "no-new-func": "error",
164
+ "no-new-object": "error",
165
+ "no-new-wrappers": "error",
166
+ "no-nonoctal-decimal-escape": "error",
167
+ "no-octal": "error",
168
+ "no-octal-escape": "error",
169
+ "no-param-reassign": "off",
170
+ "no-plusplus": "off",
171
+ "no-proto": "error",
172
+ "no-redeclare": "error",
173
+ "no-regex-spaces": "error",
174
+ "no-restricted-exports": "error",
175
+ "no-restricted-globals": "off",
176
+ "no-restricted-imports": "error",
177
+ "no-restricted-properties": "off",
178
+ "no-restricted-syntax": "error",
179
+ "no-return-assign": "error",
180
+ "no-script-url": "error",
181
+ "no-sequences": "error",
182
+ "no-shadow": "off",
183
+ "no-shadow-restricted-names": "error",
184
+ "no-ternary": "off",
185
+ "no-throw-literal": "error",
186
+ "no-undef-init": "error",
187
+ "no-undefined": "off",
188
+ "no-underscore-dangle": "off",
189
+ "no-unneeded-ternary": "error",
190
+ "no-unused-expressions": "error",
191
+ "no-unused-labels": "error",
192
+ "no-useless-call": "error",
193
+ "no-useless-catch": "error",
194
+ "no-useless-computed-key": "error",
195
+ "no-useless-concat": "error",
196
+ "no-useless-constructor": "error",
197
+ "no-useless-escape": "off",
198
+ "no-useless-rename": "error",
199
+ "no-useless-return": "error",
200
+ "no-var": "off", // update to error
201
+ "no-void": "error",
202
+ "no-warning-comments": "off",
203
+ "no-with": "error",
204
+ "object-shorthand": "off",
205
+ "one-var": "off",
206
+ "one-var-declaration-per-line": "off",
207
+ "operator-assignment": ["error", "always"],
208
+ "prefer-arrow-callback": "error",
209
+ "prefer-const": "error",
210
+ "prefer-destructuring": "off",
211
+ "prefer-exponentiation-operator": "off",
212
+ "prefer-named-capture-group": "off",
213
+ "prefer-numeric-literals": "error",
214
+ "prefer-object-has-own": "off",
215
+ "prefer-object-spread": "off",
216
+ "prefer-promise-reject-errors": "error",
217
+ "prefer-regex-literals": "off",
218
+ "prefer-rest-params": "off",
219
+ "prefer-spread": "warn",
220
+ "prefer-template": "error",
221
+ "quote-props": "off",
222
+ "radix": "error",
223
+ "require-await": "error",
224
+ "require-unicode-regexp": "off",
225
+ "require-yield": "error",
226
+ "sort-imports": "off",
227
+ "sort-keys": "off",
228
+ "sort-vars": "off",
229
+ "spaced-comment": [
230
+ "error", "always", {
231
+ "exceptions": ["/"]
232
+ }
233
+ ],
234
+ "strict": "error",
235
+ "symbol-description": "error",
236
+ "vars-on-top": "off",
237
+ "yoda": "error",
238
+
239
+ // Layout & Formatting
240
+ "array-bracket-newline": ["error", "consistent"],
241
+ "array-bracket-spacing": ["error", "never"],
242
+ "array-element-newline": "off",
243
+ "arrow-parens": [
244
+ "error", "as-needed", {
245
+ "requireForBlockBody": true
246
+ }
247
+ ],
248
+ "arrow-spacing": "error",
249
+ "block-spacing": "error",
250
+ "brace-style": "error",
251
+ "comma-dangle": ["error", "never"],
252
+ "comma-spacing": [
253
+ "error", {
254
+ "before": false,
255
+ "after": true
256
+ }
257
+ ],
258
+ "comma-style": ["error", "last"],
259
+ "computed-property-spacing": ["error", "never"],
260
+ "dot-location": ["error", "property"],
261
+ "eol-last": ["error", "always"],
262
+ "func-call-spacing": ["error", "never"],
263
+ "function-call-argument-newline": "off",
264
+ "function-paren-newline": "off",
265
+ "generator-star-spacing": "error",
266
+ "implicit-arrow-linebreak": "error",
267
+ "indent": [
268
+ "error", 4, {
269
+ "CallExpression": { "arguments": "first" },
270
+ "FunctionExpression": { "body": 1, "parameters": 2 },
271
+ "MemberExpression": 0,
272
+ "SwitchCase": 1,
273
+ "ignoreComments": true
274
+ }
275
+ ],
276
+ "jsx-quotes": "off",
277
+ "key-spacing": [
278
+ "error", {
279
+ "beforeColon": false,
280
+ "afterColon": true
281
+ }
282
+ ],
283
+ "keyword-spacing": [
284
+ "error", {
285
+ "before": true,
286
+ "after": true
287
+ }
288
+ ],
289
+ "line-comment-position": "off",
290
+ "linebreak-style": "off",
291
+ "lines-around-comment": "off",
292
+ "lines-between-class-members": ["error", "always"],
293
+ "max-len": "off",
294
+ "max-statements-per-line": "off",
295
+ "multiline-ternary": "off",
296
+ "new-parens": "error",
297
+ "newline-per-chained-call": "off",
298
+ "no-extra-parens": ["error", "functions"],
299
+ "no-mixed-spaces-and-tabs": "error",
300
+ "no-multi-spaces": [
301
+ "error", {
302
+ "ignoreEOLComments": true,
303
+ "exceptions": {
304
+ "ArrayExpression": true,
305
+ "AssignmentExpression": true,
306
+ "BinaryExpression": true,
307
+ "IfStatement": true,
308
+ "LogicalExpression": true,
309
+ "SwitchCase": true,
310
+ "VariableDeclarator": true
311
+ }
312
+ }
313
+ ],
314
+ "no-multiple-empty-lines": [
315
+ "error", {
316
+ "max": 2,
317
+ "maxBOF": 0,
318
+ "maxEOF": 0
319
+ }
320
+ ],
321
+ "no-tabs": "error",
322
+ "no-trailing-spaces": "error",
323
+ "no-whitespace-before-property": "error",
324
+ "nonblock-statement-body-position": "off",
325
+ "object-curly-newline": [
326
+ "error", {
327
+ "consistent": true
328
+ }
329
+ ],
330
+ "object-curly-spacing": ["error", "always"],
331
+ "object-property-newline": [
332
+ "error", {
333
+ "allowAllPropertiesOnSameLine": true
334
+ }
335
+ ],
336
+ "operator-linebreak": ["error", "after"],
337
+ "padded-blocks": [
338
+ "error", {
339
+ "classes": "never"
340
+ }
341
+ ],
342
+ "padding-line-between-statements": "off",
343
+ "quotes": ["error", "single"],
344
+ "rest-spread-spacing": "error",
345
+ "semi": ["error", "always"],
346
+ "semi-spacing": [
347
+ "error", {
348
+ "before": false,
349
+ "after": true
350
+ }
351
+ ],
352
+ "semi-style": ["error", "last"],
353
+ "space-before-blocks": "error",
354
+ "space-before-function-paren": [
355
+ "error", {
356
+ "anonymous": "always",
357
+ "named": "never"
358
+ }
359
+ ],
360
+ "space-in-parens": ["error", "never"],
361
+ "space-infix-ops": [
362
+ "error", {
363
+ "int32Hint": false
364
+ }
365
+ ],
366
+ "space-unary-ops": [
367
+ "error", {
368
+ "words": true,
369
+ "nonwords": false,
370
+ "overrides": {
371
+ }
372
+ }],
373
+ "switch-colon-spacing": [
374
+ "error", {
375
+ "after": true,
376
+ "before": false
377
+ }
378
+ ],
379
+ "template-curly-spacing": "error",
380
+ "template-tag-spacing": "error",
381
+ "unicode-bom": ["error", "never"],
382
+ "wrap-iife": "off",
383
+ "wrap-regex": "off",
384
+ "yield-star-spacing": "error",
385
+
386
+ // Import rules
387
+
388
+ // Static analysis
389
+ "import/default": "error",
390
+ "import/named": "error",
391
+ "import/namespace": "error",
392
+ "import/no-unresolved": "error",
393
+ "import/order": ["error", {
394
+ "groups": ["builtin", "external", "internal", ["parent", "sibling"], "index", "unknown"],
395
+ "newlines-between": "always",
396
+ "alphabetize": { "order": "asc", "caseInsensitive": true }
397
+ }],
398
+
399
+ // Helpful warnings
400
+ "import/export": "error",
401
+ "import/no-named-as-default": "warn",
402
+ "import/no-named-as-default-member": "warn",
403
+
404
+ // Style guide
405
+ "import/extensions": ["error", "always", { "ts": "never", "tsx": "never" }],
406
+ "import/no-duplicates": "warn",
407
+
408
+ // JSDoc rules
409
+ "jsdoc/check-access": "error",
410
+ "jsdoc/check-alignment": "error",
411
+ "jsdoc/check-examples": "off",
412
+ "jsdoc/check-indentation": "off",
413
+ "jsdoc/check-line-alignment": "error",
414
+ "jsdoc/check-param-names": "off",
415
+ "jsdoc/check-property-names": "error",
416
+ "jsdoc/check-syntax": "error",
417
+ "jsdoc/check-tag-names": ["error", { "definedTags": ["import"] }],
418
+ "jsdoc/check-types": "off",
419
+ "jsdoc/check-values": "error",
420
+ "jsdoc/empty-tags": "error",
421
+ "jsdoc/implements-on-classes": "error",
422
+ "jsdoc/informative-docs": "off",
423
+ "jsdoc/match-description": "off",
424
+ "jsdoc/match-name": "off",
425
+ "jsdoc/multiline-blocks": "error",
426
+ "jsdoc/no-bad-blocks": "error",
427
+ "jsdoc/no-blank-block-descriptions": "error",
428
+ "jsdoc/no-blank-blocks": "error",
429
+ "jsdoc/no-defaults": "error",
430
+ "jsdoc/no-missing-syntax": "off",
431
+ "jsdoc/no-multi-asterisks": "error",
432
+ "jsdoc/no-restricted-syntax": "off",
433
+ "jsdoc/no-types": "off",
434
+ "jsdoc/no-undefined-types": "off",
435
+ "jsdoc/require-asterisk-prefix": "error",
436
+ "jsdoc/require-description": "off",
437
+ "jsdoc/require-description-complete-sentence": [
438
+ "off", {
439
+ "abbreviations": ["e.g."]
440
+ }
441
+ ],
442
+ "jsdoc/require-example": "off",
443
+ "jsdoc/require-file-overview": "off",
444
+ "jsdoc/require-hyphen-before-param-description": ["error", "always"],
445
+ "jsdoc/require-jsdoc": "off",
446
+ "jsdoc/require-param": "error",
447
+ "jsdoc/require-param-description": "error",
448
+ "jsdoc/require-param-name": "error",
449
+ "jsdoc/require-param-type": "error",
450
+ "jsdoc/require-property": "error",
451
+ "jsdoc/require-property-description": "error",
452
+ "jsdoc/require-property-name": "error",
453
+ "jsdoc/require-property-type": "error",
454
+ "jsdoc/require-returns": "error",
455
+ "jsdoc/require-returns-check": "error",
456
+ "jsdoc/require-returns-description": "error",
457
+ "jsdoc/require-returns-type": "error",
458
+ "jsdoc/require-throws": "off",
459
+ "jsdoc/require-yields": "error",
460
+ "jsdoc/require-yields-check": "error",
461
+ "jsdoc/sort-tags": "off",
462
+ "jsdoc/tag-lines": "off",
463
+ "jsdoc/text-escaping": "off",
464
+ "jsdoc/valid-types": "off",
465
+
466
+ // Regex rules
467
+ "no-control-regex": "error",
468
+ "no-misleading-character-class": "error",
469
+ "no-regex-spaces": "error",
470
+ "prefer-regex-literals": "error",
471
+ "no-invalid-regexp": "off",
472
+ "no-useless-backreference": "off",
473
+ "no-empty-character-class": "off",
474
+ "regexp/confusing-quantifier": "warn",
475
+ "regexp/control-character-escape": "error",
476
+ "regexp/match-any": "error",
477
+ "regexp/negation": "error",
478
+ "regexp/no-contradiction-with-assertion": "error",
479
+ "regexp/no-dupe-characters-character-class": "error",
480
+ "regexp/no-dupe-disjunctions": "error",
481
+ "regexp/no-empty-alternative": "warn",
482
+ "regexp/no-empty-capturing-group": "error",
483
+ "regexp/no-empty-character-class": "error",
484
+ "regexp/no-empty-group": "error",
485
+ "regexp/no-empty-lookarounds-assertion": "error",
486
+ "regexp/no-empty-string-literal": "error",
487
+ "regexp/no-escape-backspace": "error",
488
+ "regexp/no-extra-lookaround-assertions": "error",
489
+ "regexp/no-invalid-regexp": "error",
490
+ "regexp/no-invisible-character": "error",
491
+ "regexp/no-lazy-ends": "warn",
492
+ "regexp/no-legacy-features": "error",
493
+ "regexp/no-misleading-capturing-group": "error",
494
+ "regexp/no-misleading-unicode-character": "error",
495
+ "regexp/no-missing-g-flag": "error",
496
+ "regexp/no-non-standard-flag": "error",
497
+ "regexp/no-obscure-range": "error",
498
+ "regexp/no-optional-assertion": "error",
499
+ "regexp/no-potentially-useless-backreference": "warn",
500
+ "regexp/no-super-linear-backtracking": "error",
501
+ "regexp/no-trivially-nested-assertion": "error",
502
+ "regexp/no-trivially-nested-quantifier": "error",
503
+ "regexp/no-unused-capturing-group": "error",
504
+ "regexp/no-useless-assertions": "error",
505
+ "regexp/no-useless-backreference": "error",
506
+ "regexp/no-useless-character-class": "error",
507
+ "regexp/no-useless-dollar-replacements": "error",
508
+ "regexp/no-useless-escape": "error",
509
+ "regexp/no-useless-flag": "warn",
510
+ "regexp/no-useless-lazy": "error",
511
+ "regexp/no-useless-non-capturing-group": "error",
512
+ "regexp/no-useless-quantifier": "error",
513
+ "regexp/no-useless-range": "error",
514
+ "regexp/no-useless-set-operand": "error",
515
+ "regexp/no-useless-string-literal": "error",
516
+ "regexp/no-useless-two-nums-quantifier": "error",
517
+ "regexp/no-zero-quantifier": "error",
518
+ "regexp/optimal-lookaround-quantifier": "warn",
519
+ "regexp/optimal-quantifier-concatenation": "error",
520
+ "regexp/prefer-character-class": "error",
521
+ "regexp/prefer-d": "error",
522
+ "regexp/prefer-plus-quantifier": "error",
523
+ "regexp/prefer-predefined-assertion": "error",
524
+ "regexp/prefer-question-quantifier": "error",
525
+ "regexp/prefer-range": "error",
526
+ "regexp/prefer-set-operation": "error",
527
+ "regexp/prefer-star-quantifier": "error",
528
+ "regexp/prefer-unicode-codepoint-escapes": "error",
529
+ "regexp/prefer-w": "error",
530
+ "regexp/simplify-set-operations": "error",
531
+ "regexp/sort-flags": "error",
532
+ "regexp/strict": "error",
533
+ "regexp/use-ignore-case": "error",
534
+ },
535
+
536
+ "plugins": [
537
+ "import",
538
+ "jsdoc",
539
+ "regexp"
540
+ ],
541
+
542
+ "settings": {
543
+ "jsdoc": {
544
+ "mode": "typescript"
545
+ }
546
+ },
547
+
548
+ "env": {
549
+ "browser": true,
550
+ "es2022": true,
551
+ "node": true,
552
+ "worker": true
553
+ }
554
+
555
+ };
package/package.json CHANGED
@@ -1,38 +1,39 @@
1
- {
2
- "name": "@playcanvas/eslint-config",
3
- "version": "1.7.1",
4
- "author": "PlayCanvas <support@playcanvas.com>",
5
- "homepage": "https://playcanvas.com",
6
- "description": "ESLint configuration used by PlayCanvas",
7
- "keywords": [
8
- "eslint",
9
- "eslintrc",
10
- "config",
11
- "playcanvas"
12
- ],
13
- "license": "MIT",
14
- "main": "index.js",
15
- "bugs": {
16
- "url": "https://github.com/playcanvas/playcanvas-eslint-config/issues"
17
- },
18
- "repository": {
19
- "type": "git",
20
- "url": "git+https://github.com/playcanvas/playcanvas-eslint-config.git"
21
- },
22
- "files": [
23
- "LICENSE",
24
- "index.js",
25
- "package.json",
26
- "README.md"
27
- ],
28
- "dependencies": {
29
- "eslint-plugin-import": "^2.28.0",
30
- "eslint-plugin-jsdoc": "^46.4.6"
31
- },
32
- "scripts": {
33
- "test": "echo \"Error: no test specified\" && exit 1"
34
- },
35
- "peerDependencies": {
36
- "eslint": ">= 4"
37
- }
38
- }
1
+ {
2
+ "name": "@playcanvas/eslint-config",
3
+ "version": "1.7.2",
4
+ "author": "PlayCanvas <support@playcanvas.com>",
5
+ "homepage": "https://playcanvas.com",
6
+ "description": "ESLint configuration used by PlayCanvas",
7
+ "keywords": [
8
+ "eslint",
9
+ "eslintrc",
10
+ "config",
11
+ "playcanvas"
12
+ ],
13
+ "license": "MIT",
14
+ "main": "index.js",
15
+ "bugs": {
16
+ "url": "https://github.com/playcanvas/playcanvas-eslint-config/issues"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/playcanvas/playcanvas-eslint-config.git"
21
+ },
22
+ "files": [
23
+ "LICENSE",
24
+ "index.js",
25
+ "package.json",
26
+ "README.md"
27
+ ],
28
+ "dependencies": {
29
+ "eslint-plugin-import": "^2.28.0",
30
+ "eslint-plugin-jsdoc": "^46.4.6",
31
+ "eslint-plugin-regexp": "^2.6.0"
32
+ },
33
+ "scripts": {
34
+ "test": "echo \"Error: no test specified\" && exit 1"
35
+ },
36
+ "peerDependencies": {
37
+ "eslint": ">= 4"
38
+ }
39
+ }