@playcanvas/eslint-config 1.4.1 → 1.5.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 (4) hide show
  1. package/LICENSE +19 -19
  2. package/README.md +25 -25
  3. package/index.js +473 -473
  4. package/package.json +38 -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,473 +1,473 @@
1
- module.exports = {
2
-
3
- "parserOptions": {
4
- "ecmaVersion": "latest",
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-symbol": "error",
49
- "no-obj-calls": "error",
50
- "no-promise-executor-return": "error",
51
- "no-prototype-builtins": "off",
52
- "no-self-assign": "error",
53
- "no-self-compare": "error",
54
- "no-setter-return": "error",
55
- "no-sparse-arrays": "error",
56
- "no-template-curly-in-string": "error",
57
- "no-this-before-super": "error",
58
- "no-undef": "error",
59
- "no-unexpected-multiline": "error",
60
- "no-unmodified-loop-condition": "error",
61
- "no-unreachable": "error",
62
- "no-unreachable-loop": "error",
63
- "no-unsafe-finally": "error",
64
- "no-unsafe-negation": "error",
65
- "no-unsafe-optional-chaining": "error",
66
- "no-unused-private-class-members": "error",
67
- "no-unused-vars": [
68
- "error", {
69
- "args": "none"
70
- }
71
- ],
72
- "no-use-before-define": [
73
- "error", {
74
- "functions": false
75
- }
76
- ],
77
- "no-useless-backreference": "error",
78
- "require-atomic-updates": "error",
79
- "use-isnan": "error",
80
- "valid-typeof": "error",
81
-
82
- // Suggestions
83
- "accessor-pairs": "error",
84
- "arrow-body-style": "off",
85
- "block-scoped-var": "error",
86
- "camelcase": "off",
87
- "capitalized-comments": "off",
88
- "class-methods-use-this": "off",
89
- "complexity": "off",
90
- "consistent-return": "off",
91
- "consistent-this": "off",
92
- "curly": "off",
93
- "default-case": "off",
94
- "default-case-last": "off",
95
- "default-param-last": "off",
96
- "dot-notation": "error",
97
- "eqeqeq": ["error", "smart"],
98
- "func-name-matching": "error",
99
- "func-names": "off",
100
- "func-style": "off",
101
- "grouped-accessor-pairs": ["error", "setBeforeGet"],
102
- "guard-for-in": "off",
103
- "id-denylist": "off",
104
- "id-length": "off",
105
- "id-match": "off",
106
- "init-declarations": "off",
107
- "max-classes-per-file": "off",
108
- "max-depth": "off",
109
- "max-lines": "off",
110
- "max-lines-per-function": "off",
111
- "max-nested-callbacks": "off",
112
- "max-params": "off",
113
- "max-statements": "off",
114
- "multiline-comment-style": ["warn", "separate-lines"],
115
- "new-cap": "off",
116
- "no-alert": "error",
117
- "no-array-constructor": "error",
118
- "no-bitwise": "off",
119
- "no-caller": "error",
120
- "no-case-declarations": "error",
121
- "no-confusing-arrow": "error",
122
- "no-console": "off",
123
- "no-continue": "off",
124
- "no-delete-var": "error",
125
- "no-div-regex": "error",
126
- "no-else-return": "error",
127
- "no-empty": [
128
- "error", {
129
- "allowEmptyCatch": true
130
- }
131
- ],
132
- "no-empty-function": "off",
133
- "no-eq-null": "off",
134
- "no-eval": "error",
135
- "no-extend-native": "error",
136
- "no-extra-bind": "error",
137
- "no-extra-boolean-cast": "off",
138
- "no-extra-label": "error",
139
- "no-extra-semi": "error",
140
- "no-floating-decimal": "error",
141
- "no-global-assign": "error",
142
- "no-implicit-coercion": "off",
143
- "no-implicit-globals": "error",
144
- "no-implied-eval": "error",
145
- "no-inline-comments": "off",
146
- "no-invalid-this": "off",
147
- "no-iterator": "error",
148
- "no-label-var": "error",
149
- "no-labels": "error",
150
- "no-lone-blocks": "error",
151
- "no-lonely-if": "off",
152
- "no-loop-func": "error",
153
- "no-magic-numbers": "off",
154
- "no-mixed-operators": "off",
155
- "no-multi-assign": "off",
156
- "no-multi-str": "error",
157
- "no-negated-condition": "off",
158
- "no-nested-ternary": "off",
159
- "no-new": "warn",
160
- "no-new-func": "error",
161
- "no-new-object": "error",
162
- "no-new-wrappers": "error",
163
- "no-nonoctal-decimal-escape": "error",
164
- "no-octal": "error",
165
- "no-octal-escape": "error",
166
- "no-param-reassign": "off",
167
- "no-plusplus": "off",
168
- "no-proto": "error",
169
- "no-redeclare": "error",
170
- "no-regex-spaces": "error",
171
- "no-restricted-exports": "error",
172
- "no-restricted-globals": "off",
173
- "no-restricted-imports": "error",
174
- "no-restricted-properties": "off",
175
- "no-restricted-syntax": "error",
176
- "no-return-assign": "error",
177
- "no-return-await": "error",
178
- "no-script-url": "error",
179
- "no-sequences": "error",
180
- "no-shadow": "off",
181
- "no-shadow-restricted-names": "error",
182
- "no-ternary": "off",
183
- "no-throw-literal": "error",
184
- "no-undef-init": "error",
185
- "no-undefined": "off",
186
- "no-underscore-dangle": "off",
187
- "no-unneeded-ternary": "error",
188
- "no-unused-expressions": "error",
189
- "no-unused-labels": "error",
190
- "no-useless-call": "error",
191
- "no-useless-catch": "error",
192
- "no-useless-computed-key": "error",
193
- "no-useless-concat": "error",
194
- "no-useless-constructor": "error",
195
- "no-useless-escape": "off",
196
- "no-useless-rename": "error",
197
- "no-useless-return": "error",
198
- "no-var": "off", // update to error
199
- "no-void": "error",
200
- "no-warning-comments": "off",
201
- "no-with": "error",
202
- "object-shorthand": "off",
203
- "one-var": "off",
204
- "one-var-declaration-per-line": "off",
205
- "operator-assignment": ["error", "always"],
206
- "prefer-arrow-callback": "off",
207
- "prefer-const": "error",
208
- "prefer-destructuring": "off",
209
- "prefer-exponentiation-operator": "off",
210
- "prefer-named-capture-group": "off",
211
- "prefer-numeric-literals": "error",
212
- "prefer-object-has-own": "off",
213
- "prefer-object-spread": "off",
214
- "prefer-promise-reject-errors": "error",
215
- "prefer-regex-literals": "off",
216
- "prefer-rest-params": "off",
217
- "prefer-spread": "warn",
218
- "prefer-template": "off",
219
- "quote-props": "off",
220
- "radix": "error",
221
- "require-await": "error",
222
- "require-unicode-regexp": "off",
223
- "require-yield": "error",
224
- "sort-imports": "off",
225
- "sort-keys": "off",
226
- "sort-vars": "off",
227
- "spaced-comment": [
228
- "error", "always", {
229
- "exceptions": ["/"]
230
- }
231
- ],
232
- "strict": "error",
233
- "symbol-description": "error",
234
- "vars-on-top": "off",
235
- "yoda": "error",
236
-
237
- // Layout & Formatting
238
- "array-bracket-newline": ["error", "consistent"],
239
- "array-bracket-spacing": ["error", "never"],
240
- "array-element-newline": "off",
241
- "arrow-parens": [
242
- "error", "as-needed", {
243
- "requireForBlockBody": true
244
- }
245
- ],
246
- "arrow-spacing": "error",
247
- "block-spacing": "error",
248
- "brace-style": "error",
249
- "comma-dangle": ["error", "never"],
250
- "comma-spacing": [
251
- "error", {
252
- "before": false,
253
- "after": true
254
- }
255
- ],
256
- "comma-style": ["error", "last"],
257
- "computed-property-spacing": ["error", "never"],
258
- "dot-location": ["error", "property"],
259
- "eol-last": ["error", "always"],
260
- "func-call-spacing": ["error", "never"],
261
- "function-call-argument-newline": "off",
262
- "function-paren-newline": "off",
263
- "generator-star-spacing": "error",
264
- "implicit-arrow-linebreak": "error",
265
- "indent": [
266
- "error", 4, {
267
- "SwitchCase": 1,
268
- "CallExpression": {
269
- "arguments": "first"
270
- },
271
- "ignoreComments": true
272
- }
273
- ],
274
- "jsx-quotes": "off",
275
- "key-spacing": [
276
- "error", {
277
- "beforeColon": false,
278
- "afterColon": true
279
- }
280
- ],
281
- "keyword-spacing": [
282
- "error", {
283
- "before": true,
284
- "after": true
285
- }
286
- ],
287
- "line-comment-position": "off",
288
- "linebreak-style": "off",
289
- "lines-around-comment": "off",
290
- "lines-between-class-members": ["error", "always"],
291
- "max-len": "off",
292
- "max-statements-per-line": "off",
293
- "multiline-ternary": "off",
294
- "new-parens": "error",
295
- "newline-per-chained-call": "off",
296
- "no-extra-parens": ["error", "functions"],
297
- "no-mixed-spaces-and-tabs": "error",
298
- "no-multi-spaces": [
299
- "error", {
300
- "ignoreEOLComments": true,
301
- "exceptions": {
302
- "ArrayExpression": true,
303
- "AssignmentExpression": true,
304
- "BinaryExpression": true,
305
- "IfStatement": true,
306
- "LogicalExpression": true,
307
- "SwitchCase": true,
308
- "VariableDeclarator": true
309
- }
310
- }
311
- ],
312
- "no-multiple-empty-lines": [
313
- "error", {
314
- "max": 2,
315
- "maxBOF": 0,
316
- "maxEOF": 0
317
- }
318
- ],
319
- "no-tabs": "error",
320
- "no-trailing-spaces": "error",
321
- "no-whitespace-before-property": "error",
322
- "nonblock-statement-body-position": "off",
323
- "object-curly-newline": [
324
- "error", {
325
- "consistent": true
326
- }
327
- ],
328
- "object-curly-spacing": ["error", "always"],
329
- "object-property-newline": [
330
- "error", {
331
- "allowAllPropertiesOnSameLine": true
332
- }
333
- ],
334
- "operator-linebreak": ["error", "after"],
335
- "padded-blocks": [
336
- "error", {
337
- "classes": "never"
338
- }
339
- ],
340
- "padding-line-between-statements": "off",
341
- "quotes": ["off", "single"],
342
- "rest-spread-spacing": "error",
343
- "semi": ["error", "always"],
344
- "semi-spacing": [
345
- "error", {
346
- "before": false,
347
- "after": true
348
- }
349
- ],
350
- "semi-style": ["error", "last"],
351
- "space-before-blocks": "error",
352
- "space-before-function-paren": [
353
- "error", {
354
- "anonymous": "always",
355
- "named": "never"
356
- }
357
- ],
358
- "space-in-parens": ["error", "never"],
359
- "space-infix-ops": [
360
- "error", {
361
- "int32Hint": false
362
- }
363
- ],
364
- "space-unary-ops": [
365
- "error", {
366
- "words": true,
367
- "nonwords": false,
368
- "overrides": {
369
- }
370
- }],
371
- "switch-colon-spacing": [
372
- "error", {
373
- "after": true,
374
- "before": false
375
- }
376
- ],
377
- "template-curly-spacing": "error",
378
- "template-tag-spacing": "error",
379
- "unicode-bom": ["error", "never"],
380
- "wrap-iife": "off",
381
- "wrap-regex": "off",
382
- "yield-star-spacing": "error",
383
-
384
- // Import rules
385
-
386
- // Static Analysis
387
- "import/no-unresolved": "error",
388
- "import/named": "error",
389
- "import/namespace": "error",
390
- "import/default": "error",
391
- "import/export": "error",
392
-
393
- // Helpful Warnings
394
- "import/no-named-as-default": "warn",
395
- "import/no-named-as-default-member": "warn",
396
- "import/no-duplicates": "warn",
397
-
398
- // JSDoc rules
399
- "jsdoc/check-access": "error",
400
- "jsdoc/check-alignment": "error",
401
- "jsdoc/check-examples": "off",
402
- "jsdoc/check-indentation": "off",
403
- "jsdoc/check-line-alignment": "error",
404
- "jsdoc/check-param-names": "off",
405
- "jsdoc/check-property-names": "error",
406
- "jsdoc/check-syntax": "error",
407
- "jsdoc/check-tag-names": "error",
408
- "jsdoc/check-types": "error",
409
- "jsdoc/check-values": "error",
410
- "jsdoc/empty-tags": "error",
411
- "jsdoc/implements-on-classes": "error",
412
- "jsdoc/informative-docs": "off",
413
- "jsdoc/match-description": "off",
414
- "jsdoc/match-name": "off",
415
- "jsdoc/multiline-blocks": "error",
416
- "jsdoc/no-bad-blocks": "error",
417
- "jsdoc/no-blank-block-descriptions": "error",
418
- "jsdoc/no-defaults": "off",
419
- "jsdoc/no-missing-syntax": "off",
420
- "jsdoc/no-multi-asterisks": "error",
421
- "jsdoc/no-restricted-syntax": "off",
422
- "jsdoc/no-types": "off",
423
- "jsdoc/no-undefined-types": "off",
424
- "jsdoc/require-asterisk-prefix": "error",
425
- "jsdoc/require-description": "off",
426
- "jsdoc/require-description-complete-sentence": [
427
- "off", {
428
- "abbreviations": ["e.g."]
429
- }
430
- ],
431
- "jsdoc/require-example": "off",
432
- "jsdoc/require-file-overview": "off",
433
- "jsdoc/require-hyphen-before-param-description": ["error", "always"],
434
- "jsdoc/require-jsdoc": "off",
435
- "jsdoc/require-param": "error",
436
- "jsdoc/require-param-description": "error",
437
- "jsdoc/require-param-name": "error",
438
- "jsdoc/require-param-type": "error",
439
- "jsdoc/require-property": "error",
440
- "jsdoc/require-property-description": "error",
441
- "jsdoc/require-property-name": "error",
442
- "jsdoc/require-property-type": "error",
443
- "jsdoc/require-returns": "error",
444
- "jsdoc/require-returns-check": "error",
445
- "jsdoc/require-returns-description": "error",
446
- "jsdoc/require-returns-type": "error",
447
- "jsdoc/require-throws": "off",
448
- "jsdoc/require-yields": "error",
449
- "jsdoc/require-yields-check": "error",
450
- "jsdoc/sort-tags": "off",
451
- "jsdoc/tag-lines": "off",
452
- "jsdoc/valid-types": "off"
453
- },
454
-
455
- "plugins": [
456
- "import",
457
- "jsdoc"
458
- ],
459
-
460
- "settings": {
461
- "jsdoc": {
462
- "mode": "typescript"
463
- }
464
- },
465
-
466
- "env": {
467
- "browser": true,
468
- "es6": true,
469
- "node": true,
470
- "worker": true
471
- }
472
-
473
- };
1
+ module.exports = {
2
+
3
+ "parserOptions": {
4
+ "ecmaVersion": "latest",
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-symbol": "error",
49
+ "no-obj-calls": "error",
50
+ "no-promise-executor-return": "error",
51
+ "no-prototype-builtins": "off",
52
+ "no-self-assign": "error",
53
+ "no-self-compare": "error",
54
+ "no-setter-return": "error",
55
+ "no-sparse-arrays": "error",
56
+ "no-template-curly-in-string": "error",
57
+ "no-this-before-super": "error",
58
+ "no-undef": "error",
59
+ "no-unexpected-multiline": "error",
60
+ "no-unmodified-loop-condition": "error",
61
+ "no-unreachable": "error",
62
+ "no-unreachable-loop": "error",
63
+ "no-unsafe-finally": "error",
64
+ "no-unsafe-negation": "error",
65
+ "no-unsafe-optional-chaining": "error",
66
+ "no-unused-private-class-members": "error",
67
+ "no-unused-vars": [
68
+ "error", {
69
+ "args": "none"
70
+ }
71
+ ],
72
+ "no-use-before-define": [
73
+ "error", {
74
+ "functions": false
75
+ }
76
+ ],
77
+ "no-useless-backreference": "error",
78
+ "require-atomic-updates": "error",
79
+ "use-isnan": "error",
80
+ "valid-typeof": "error",
81
+
82
+ // Suggestions
83
+ "accessor-pairs": "error",
84
+ "arrow-body-style": "off",
85
+ "block-scoped-var": "error",
86
+ "camelcase": "off",
87
+ "capitalized-comments": "off",
88
+ "class-methods-use-this": "off",
89
+ "complexity": "off",
90
+ "consistent-return": "off",
91
+ "consistent-this": "off",
92
+ "curly": "off",
93
+ "default-case": "off",
94
+ "default-case-last": "off",
95
+ "default-param-last": "off",
96
+ "dot-notation": "error",
97
+ "eqeqeq": ["error", "smart"],
98
+ "func-name-matching": "error",
99
+ "func-names": "off",
100
+ "func-style": "off",
101
+ "grouped-accessor-pairs": ["error", "setBeforeGet"],
102
+ "guard-for-in": "off",
103
+ "id-denylist": "off",
104
+ "id-length": "off",
105
+ "id-match": "off",
106
+ "init-declarations": "off",
107
+ "max-classes-per-file": "off",
108
+ "max-depth": "off",
109
+ "max-lines": "off",
110
+ "max-lines-per-function": "off",
111
+ "max-nested-callbacks": "off",
112
+ "max-params": "off",
113
+ "max-statements": "off",
114
+ "multiline-comment-style": ["warn", "separate-lines"],
115
+ "new-cap": "off",
116
+ "no-alert": "error",
117
+ "no-array-constructor": "error",
118
+ "no-bitwise": "off",
119
+ "no-caller": "error",
120
+ "no-case-declarations": "error",
121
+ "no-confusing-arrow": "error",
122
+ "no-console": "off",
123
+ "no-continue": "off",
124
+ "no-delete-var": "error",
125
+ "no-div-regex": "error",
126
+ "no-else-return": "error",
127
+ "no-empty": [
128
+ "error", {
129
+ "allowEmptyCatch": true
130
+ }
131
+ ],
132
+ "no-empty-function": "off",
133
+ "no-eq-null": "off",
134
+ "no-eval": "error",
135
+ "no-extend-native": "error",
136
+ "no-extra-bind": "error",
137
+ "no-extra-boolean-cast": "off",
138
+ "no-extra-label": "error",
139
+ "no-extra-semi": "error",
140
+ "no-floating-decimal": "error",
141
+ "no-global-assign": "error",
142
+ "no-implicit-coercion": "off",
143
+ "no-implicit-globals": "error",
144
+ "no-implied-eval": "error",
145
+ "no-inline-comments": "off",
146
+ "no-invalid-this": "off",
147
+ "no-iterator": "error",
148
+ "no-label-var": "error",
149
+ "no-labels": "error",
150
+ "no-lone-blocks": "error",
151
+ "no-lonely-if": "off",
152
+ "no-loop-func": "error",
153
+ "no-magic-numbers": "off",
154
+ "no-mixed-operators": "off",
155
+ "no-multi-assign": "off",
156
+ "no-multi-str": "error",
157
+ "no-negated-condition": "off",
158
+ "no-nested-ternary": "off",
159
+ "no-new": "warn",
160
+ "no-new-func": "error",
161
+ "no-new-object": "error",
162
+ "no-new-wrappers": "error",
163
+ "no-nonoctal-decimal-escape": "error",
164
+ "no-octal": "error",
165
+ "no-octal-escape": "error",
166
+ "no-param-reassign": "off",
167
+ "no-plusplus": "off",
168
+ "no-proto": "error",
169
+ "no-redeclare": "error",
170
+ "no-regex-spaces": "error",
171
+ "no-restricted-exports": "error",
172
+ "no-restricted-globals": "off",
173
+ "no-restricted-imports": "error",
174
+ "no-restricted-properties": "off",
175
+ "no-restricted-syntax": "error",
176
+ "no-return-assign": "error",
177
+ "no-return-await": "error",
178
+ "no-script-url": "error",
179
+ "no-sequences": "error",
180
+ "no-shadow": "off",
181
+ "no-shadow-restricted-names": "error",
182
+ "no-ternary": "off",
183
+ "no-throw-literal": "error",
184
+ "no-undef-init": "error",
185
+ "no-undefined": "off",
186
+ "no-underscore-dangle": "off",
187
+ "no-unneeded-ternary": "error",
188
+ "no-unused-expressions": "error",
189
+ "no-unused-labels": "error",
190
+ "no-useless-call": "error",
191
+ "no-useless-catch": "error",
192
+ "no-useless-computed-key": "error",
193
+ "no-useless-concat": "error",
194
+ "no-useless-constructor": "error",
195
+ "no-useless-escape": "off",
196
+ "no-useless-rename": "error",
197
+ "no-useless-return": "error",
198
+ "no-var": "off", // update to error
199
+ "no-void": "error",
200
+ "no-warning-comments": "off",
201
+ "no-with": "error",
202
+ "object-shorthand": "off",
203
+ "one-var": "off",
204
+ "one-var-declaration-per-line": "off",
205
+ "operator-assignment": ["error", "always"],
206
+ "prefer-arrow-callback": "off",
207
+ "prefer-const": "error",
208
+ "prefer-destructuring": "off",
209
+ "prefer-exponentiation-operator": "off",
210
+ "prefer-named-capture-group": "off",
211
+ "prefer-numeric-literals": "error",
212
+ "prefer-object-has-own": "off",
213
+ "prefer-object-spread": "off",
214
+ "prefer-promise-reject-errors": "error",
215
+ "prefer-regex-literals": "off",
216
+ "prefer-rest-params": "off",
217
+ "prefer-spread": "warn",
218
+ "prefer-template": "off",
219
+ "quote-props": "off",
220
+ "radix": "error",
221
+ "require-await": "error",
222
+ "require-unicode-regexp": "off",
223
+ "require-yield": "error",
224
+ "sort-imports": "off",
225
+ "sort-keys": "off",
226
+ "sort-vars": "off",
227
+ "spaced-comment": [
228
+ "error", "always", {
229
+ "exceptions": ["/"]
230
+ }
231
+ ],
232
+ "strict": "error",
233
+ "symbol-description": "error",
234
+ "vars-on-top": "off",
235
+ "yoda": "error",
236
+
237
+ // Layout & Formatting
238
+ "array-bracket-newline": ["error", "consistent"],
239
+ "array-bracket-spacing": ["error", "never"],
240
+ "array-element-newline": "off",
241
+ "arrow-parens": [
242
+ "error", "as-needed", {
243
+ "requireForBlockBody": true
244
+ }
245
+ ],
246
+ "arrow-spacing": "error",
247
+ "block-spacing": "error",
248
+ "brace-style": "error",
249
+ "comma-dangle": ["error", "never"],
250
+ "comma-spacing": [
251
+ "error", {
252
+ "before": false,
253
+ "after": true
254
+ }
255
+ ],
256
+ "comma-style": ["error", "last"],
257
+ "computed-property-spacing": ["error", "never"],
258
+ "dot-location": ["error", "property"],
259
+ "eol-last": ["error", "always"],
260
+ "func-call-spacing": ["error", "never"],
261
+ "function-call-argument-newline": "off",
262
+ "function-paren-newline": "off",
263
+ "generator-star-spacing": "error",
264
+ "implicit-arrow-linebreak": "error",
265
+ "indent": [
266
+ "error", 4, {
267
+ "SwitchCase": 1,
268
+ "CallExpression": {
269
+ "arguments": "first"
270
+ },
271
+ "ignoreComments": true
272
+ }
273
+ ],
274
+ "jsx-quotes": "off",
275
+ "key-spacing": [
276
+ "error", {
277
+ "beforeColon": false,
278
+ "afterColon": true
279
+ }
280
+ ],
281
+ "keyword-spacing": [
282
+ "error", {
283
+ "before": true,
284
+ "after": true
285
+ }
286
+ ],
287
+ "line-comment-position": "off",
288
+ "linebreak-style": "off",
289
+ "lines-around-comment": "off",
290
+ "lines-between-class-members": ["error", "always"],
291
+ "max-len": "off",
292
+ "max-statements-per-line": "off",
293
+ "multiline-ternary": "off",
294
+ "new-parens": "error",
295
+ "newline-per-chained-call": "off",
296
+ "no-extra-parens": ["error", "functions"],
297
+ "no-mixed-spaces-and-tabs": "error",
298
+ "no-multi-spaces": [
299
+ "error", {
300
+ "ignoreEOLComments": true,
301
+ "exceptions": {
302
+ "ArrayExpression": true,
303
+ "AssignmentExpression": true,
304
+ "BinaryExpression": true,
305
+ "IfStatement": true,
306
+ "LogicalExpression": true,
307
+ "SwitchCase": true,
308
+ "VariableDeclarator": true
309
+ }
310
+ }
311
+ ],
312
+ "no-multiple-empty-lines": [
313
+ "error", {
314
+ "max": 2,
315
+ "maxBOF": 0,
316
+ "maxEOF": 0
317
+ }
318
+ ],
319
+ "no-tabs": "error",
320
+ "no-trailing-spaces": "error",
321
+ "no-whitespace-before-property": "error",
322
+ "nonblock-statement-body-position": "off",
323
+ "object-curly-newline": [
324
+ "error", {
325
+ "consistent": true
326
+ }
327
+ ],
328
+ "object-curly-spacing": ["error", "always"],
329
+ "object-property-newline": [
330
+ "error", {
331
+ "allowAllPropertiesOnSameLine": true
332
+ }
333
+ ],
334
+ "operator-linebreak": ["error", "after"],
335
+ "padded-blocks": [
336
+ "error", {
337
+ "classes": "never"
338
+ }
339
+ ],
340
+ "padding-line-between-statements": "off",
341
+ "quotes": ["off", "single"],
342
+ "rest-spread-spacing": "error",
343
+ "semi": ["error", "always"],
344
+ "semi-spacing": [
345
+ "error", {
346
+ "before": false,
347
+ "after": true
348
+ }
349
+ ],
350
+ "semi-style": ["error", "last"],
351
+ "space-before-blocks": "error",
352
+ "space-before-function-paren": [
353
+ "error", {
354
+ "anonymous": "always",
355
+ "named": "never"
356
+ }
357
+ ],
358
+ "space-in-parens": ["error", "never"],
359
+ "space-infix-ops": [
360
+ "error", {
361
+ "int32Hint": false
362
+ }
363
+ ],
364
+ "space-unary-ops": [
365
+ "error", {
366
+ "words": true,
367
+ "nonwords": false,
368
+ "overrides": {
369
+ }
370
+ }],
371
+ "switch-colon-spacing": [
372
+ "error", {
373
+ "after": true,
374
+ "before": false
375
+ }
376
+ ],
377
+ "template-curly-spacing": "error",
378
+ "template-tag-spacing": "error",
379
+ "unicode-bom": ["error", "never"],
380
+ "wrap-iife": "off",
381
+ "wrap-regex": "off",
382
+ "yield-star-spacing": "error",
383
+
384
+ // Import rules
385
+
386
+ // Static Analysis
387
+ "import/no-unresolved": "error",
388
+ "import/named": "error",
389
+ "import/namespace": "error",
390
+ "import/default": "error",
391
+ "import/export": "error",
392
+
393
+ // Helpful Warnings
394
+ "import/no-named-as-default": "warn",
395
+ "import/no-named-as-default-member": "warn",
396
+ "import/no-duplicates": "warn",
397
+
398
+ // JSDoc rules
399
+ "jsdoc/check-access": "error",
400
+ "jsdoc/check-alignment": "error",
401
+ "jsdoc/check-examples": "off",
402
+ "jsdoc/check-indentation": "off",
403
+ "jsdoc/check-line-alignment": "error",
404
+ "jsdoc/check-param-names": "off",
405
+ "jsdoc/check-property-names": "error",
406
+ "jsdoc/check-syntax": "error",
407
+ "jsdoc/check-tag-names": "error",
408
+ "jsdoc/check-types": "off",
409
+ "jsdoc/check-values": "error",
410
+ "jsdoc/empty-tags": "error",
411
+ "jsdoc/implements-on-classes": "error",
412
+ "jsdoc/informative-docs": "off",
413
+ "jsdoc/match-description": "off",
414
+ "jsdoc/match-name": "off",
415
+ "jsdoc/multiline-blocks": "error",
416
+ "jsdoc/no-bad-blocks": "error",
417
+ "jsdoc/no-blank-block-descriptions": "error",
418
+ "jsdoc/no-defaults": "off",
419
+ "jsdoc/no-missing-syntax": "off",
420
+ "jsdoc/no-multi-asterisks": "error",
421
+ "jsdoc/no-restricted-syntax": "off",
422
+ "jsdoc/no-types": "off",
423
+ "jsdoc/no-undefined-types": "off",
424
+ "jsdoc/require-asterisk-prefix": "error",
425
+ "jsdoc/require-description": "off",
426
+ "jsdoc/require-description-complete-sentence": [
427
+ "off", {
428
+ "abbreviations": ["e.g."]
429
+ }
430
+ ],
431
+ "jsdoc/require-example": "off",
432
+ "jsdoc/require-file-overview": "off",
433
+ "jsdoc/require-hyphen-before-param-description": ["error", "always"],
434
+ "jsdoc/require-jsdoc": "off",
435
+ "jsdoc/require-param": "error",
436
+ "jsdoc/require-param-description": "error",
437
+ "jsdoc/require-param-name": "error",
438
+ "jsdoc/require-param-type": "error",
439
+ "jsdoc/require-property": "error",
440
+ "jsdoc/require-property-description": "error",
441
+ "jsdoc/require-property-name": "error",
442
+ "jsdoc/require-property-type": "error",
443
+ "jsdoc/require-returns": "error",
444
+ "jsdoc/require-returns-check": "error",
445
+ "jsdoc/require-returns-description": "error",
446
+ "jsdoc/require-returns-type": "error",
447
+ "jsdoc/require-throws": "off",
448
+ "jsdoc/require-yields": "error",
449
+ "jsdoc/require-yields-check": "error",
450
+ "jsdoc/sort-tags": "off",
451
+ "jsdoc/tag-lines": "off",
452
+ "jsdoc/valid-types": "off"
453
+ },
454
+
455
+ "plugins": [
456
+ "import",
457
+ "jsdoc"
458
+ ],
459
+
460
+ "settings": {
461
+ "jsdoc": {
462
+ "mode": "typescript"
463
+ }
464
+ },
465
+
466
+ "env": {
467
+ "browser": true,
468
+ "es2020": true,
469
+ "node": true,
470
+ "worker": true
471
+ }
472
+
473
+ };
package/package.json CHANGED
@@ -1,38 +1,38 @@
1
- {
2
- "name": "@playcanvas/eslint-config",
3
- "version": "1.4.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.27.5",
30
- "eslint-plugin-jsdoc": "^44.0.2"
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.5.0",
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.27.5",
30
+ "eslint-plugin-jsdoc": "^44.0.2"
31
+ },
32
+ "scripts": {
33
+ "test": "echo \"Error: no test specified\" && exit 1"
34
+ },
35
+ "peerDependencies": {
36
+ "eslint": ">= 4"
37
+ }
38
+ }