@playcanvas/eslint-config 1.0.8 → 1.0.9

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 (2) hide show
  1. package/index.js +134 -125
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -8,34 +8,35 @@ module.exports = {
8
8
 
9
9
  // Rules reference: https://eslint.org/docs/rules/
10
10
  "rules": {
11
- // Possible Errors
11
+ // Possible Problems
12
+ "array-callback-return": "error",
13
+ "constructor-super": "error",
12
14
  "for-direction": "error",
13
15
  "getter-return": "error",
16
+ "no-async-promise-executor": "error",
14
17
  "no-await-in-loop": "error",
18
+ "no-class-assign": "error",
15
19
  "no-compare-neg-zero": "error",
16
20
  "no-cond-assign": "error",
17
- "no-console": "off",
21
+ "no-const-assign": "error",
18
22
  "no-constant-condition": [
19
23
  "error", {
20
24
  "checkLoops": false
21
25
  }
22
26
  ],
27
+ "no-constructor-return": "error",
23
28
  "no-control-regex": "error",
24
29
  "no-debugger": "error",
25
30
  "no-dupe-args": "error",
31
+ "no-dupe-class-members": "error",
26
32
  "no-dupe-else-if": "error",
27
33
  "no-dupe-keys": "error",
28
34
  "no-duplicate-case": "error",
29
- "no-empty": [
30
- "error", {
31
- "allowEmptyCatch": true
32
- }
33
- ],
35
+ "no-duplicate-imports": "error",
34
36
  "no-empty-character-class": "error",
37
+ "no-empty-pattern": "error",
35
38
  "no-ex-assign": "error",
36
- "no-extra-boolean-cast": "off",
37
- "no-extra-parens": ["error", "functions"],
38
- "no-extra-semi": "error",
39
+ "no-fallthrough": "error",
39
40
  "no-func-assign": "error",
40
41
  "no-import-assign": "error",
41
42
  "no-inner-declarations": "error",
@@ -43,150 +44,205 @@ module.exports = {
43
44
  "no-irregular-whitespace": "error",
44
45
  "no-loss-of-precision": "error",
45
46
  "no-misleading-character-class": "error",
47
+ "no-new-symbol": "error",
46
48
  "no-obj-calls": "error",
47
49
  "no-promise-executor-return": "error",
48
50
  "no-prototype-builtins": "off",
49
- "no-regex-spaces": "error",
51
+ "no-self-assign": "error",
52
+ "no-self-compare": "error",
50
53
  "no-setter-return": "error",
51
54
  "no-sparse-arrays": "error",
52
55
  "no-template-curly-in-string": "error",
56
+ "no-this-before-super": "error",
57
+ "no-undef": "off",
53
58
  "no-unexpected-multiline": "error",
59
+ "no-unmodified-loop-condition": "error",
54
60
  "no-unreachable": "error",
55
61
  "no-unreachable-loop": "off",
56
62
  "no-unsafe-finally": "error",
57
63
  "no-unsafe-negation": "error",
58
64
  "no-unsafe-optional-chaining": "error",
65
+ "no-unused-private-class-members": "off", // update to error (requires eslint 8.1.0)
66
+ "no-unused-vars": [
67
+ "warn", {
68
+ "args": "none"
69
+ }
70
+ ],
71
+ "no-use-before-define": ["error", { "functions": false }],
59
72
  "no-useless-backreference": "error",
60
73
  "require-atomic-updates": "error",
61
74
  "use-isnan": "error",
62
75
  "valid-typeof": "error",
63
76
 
64
- // Best Practices
77
+ // Suggestions
65
78
  "accessor-pairs": "error",
66
- "array-callback-return": "error",
79
+ "arrow-body-style": "off",
67
80
  "block-scoped-var": "error",
81
+ "camelcase": "off",
82
+ "capitalized-comments": "off",
68
83
  "class-methods-use-this": "off",
69
84
  "complexity": "off",
70
85
  "consistent-return": "off",
86
+ "consistent-this": "off",
71
87
  "curly": "off",
72
88
  "default-case": "off",
73
89
  "default-case-last": "off",
74
90
  "default-param-last": "off",
75
- "dot-location": ["error", "property"],
76
91
  "dot-notation": "error",
77
92
  "eqeqeq": "off",
93
+ "func-name-matching": "error",
94
+ "func-names": "off",
95
+ "func-style": "off",
78
96
  "grouped-accessor-pairs": "error",
79
97
  "guard-for-in": "off",
98
+ "id-denylist": "off",
99
+ "id-length": "off",
100
+ "id-match": "off",
101
+ "init-declarations": "off",
80
102
  "max-classes-per-file": "off",
103
+ "max-depth": "off",
104
+ "max-lines": "off",
105
+ "max-lines-per-function": "off",
106
+ "max-nested-callbacks": "off",
107
+ "max-params": "off",
108
+ "max-statements": "off",
109
+ "multiline-comment-style": ["warn", "separate-lines"],
110
+ "new-cap": "off",
81
111
  "no-alert": "error",
112
+ "no-array-constructor": "error",
113
+ "no-bitwise": "off",
82
114
  "no-caller": "error",
83
115
  "no-case-declarations": "error",
84
- "no-constructor-return": "error",
116
+ "no-confusing-arrow": "error",
117
+ "no-console": "off",
118
+ "no-continue": "off",
119
+ "no-delete-var": "error",
85
120
  "no-div-regex": "error",
86
121
  "no-else-return": "error",
122
+ "no-empty": [
123
+ "error", {
124
+ "allowEmptyCatch": true
125
+ }
126
+ ],
87
127
  "no-empty-function": "off",
88
- "no-empty-pattern": "error",
89
128
  "no-eq-null": "off",
90
129
  "no-eval": "error",
91
130
  "no-extend-native": "error",
92
131
  "no-extra-bind": "error",
132
+ "no-extra-boolean-cast": "off",
93
133
  "no-extra-label": "error",
94
- "no-fallthrough": "error",
134
+ "no-extra-semi": "error",
95
135
  "no-floating-decimal": "error",
96
136
  "no-global-assign": "error",
97
137
  "no-implicit-coercion": "off",
98
138
  "no-implicit-globals": "error",
99
139
  "no-implied-eval": "error",
140
+ "no-inline-comments": "off",
100
141
  "no-invalid-this": "off",
101
142
  "no-iterator": "error",
143
+ "no-label-var": "error",
102
144
  "no-labels": "error",
103
145
  "no-lone-blocks": "error",
146
+ "no-lonely-if": "off",
104
147
  "no-loop-func": "error",
105
148
  "no-magic-numbers": "off",
106
- "no-multi-spaces": "off",
149
+ "no-mixed-operators": "off",
150
+ "no-multi-assign": "off",
107
151
  "no-multi-str": "error",
152
+ "no-negated-condition": "off",
153
+ "no-nested-ternary": "off",
108
154
  "no-new": "warn",
109
155
  "no-new-func": "error",
156
+ "no-new-object": "error",
110
157
  "no-new-wrappers": "error",
111
158
  "no-nonoctal-decimal-escape": "error",
112
159
  "no-octal": "error",
113
160
  "no-octal-escape": "error",
114
161
  "no-param-reassign": "off",
162
+ "no-plusplus": "off",
115
163
  "no-proto": "error",
116
164
  "no-redeclare": "error",
165
+ "no-regex-spaces": "error",
166
+ "no-restricted-exports": "error",
167
+ "no-restricted-globals": "off",
168
+ "no-restricted-imports": "error",
117
169
  "no-restricted-properties": "off",
170
+ "no-restricted-syntax": "error",
118
171
  "no-return-assign": "error",
119
172
  "no-return-await": "error",
120
173
  "no-script-url": "error",
121
- "no-self-assign": "error",
122
- "no-self-compare": "error",
123
174
  "no-sequences": "error",
175
+ "no-shadow": "off",
176
+ "no-shadow-restricted-names": "error",
177
+ "no-ternary": "off",
124
178
  "no-throw-literal": "error",
125
- "no-unmodified-loop-condition": "error",
179
+ "no-undef-init": "error",
180
+ "no-undefined": "off",
181
+ "no-underscore-dangle": "off",
182
+ "no-unneeded-ternary": "error",
126
183
  "no-unused-expressions": "error",
127
184
  "no-unused-labels": "error",
128
185
  "no-useless-call": "error",
129
186
  "no-useless-catch": "error",
187
+ "no-useless-computed-key": "error",
130
188
  "no-useless-concat": "error",
189
+ "no-useless-constructor": "error",
131
190
  "no-useless-escape": "off",
191
+ "no-useless-rename": "error",
132
192
  "no-useless-return": "error",
193
+ "no-var": "off", // update to error
133
194
  "no-void": "error",
134
195
  "no-warning-comments": "off",
135
196
  "no-with": "error",
197
+ "object-shorthand": "off",
198
+ "one-var": "off",
199
+ "one-var-declaration-per-line": "off",
200
+ "operator-assignment": ["error", "always"],
201
+ "prefer-arrow-callback": "off",
202
+ "prefer-const": "error",
203
+ "prefer-destructuring": "off",
204
+ "prefer-exponentiation-operator": "off",
136
205
  "prefer-named-capture-group": "off",
206
+ "prefer-numeric-literals": "error",
207
+ "prefer-object-spread": "off",
137
208
  "prefer-promise-reject-errors": "error",
138
209
  "prefer-regex-literals": "off",
210
+ "prefer-rest-params": "off",
211
+ "prefer-spread": "warn",
212
+ "prefer-template": "off",
213
+ "quote-props": "off",
139
214
  "radix": "error",
140
215
  "require-await": "error",
141
216
  "require-unicode-regexp": "off",
217
+ "require-yield": "error",
218
+ "sort-imports": "off",
219
+ "sort-keys": "off",
220
+ "sort-vars": "off",
221
+ "spaced-comment": ["error", "always", { "exceptions": ["/"] }],
222
+ "strict": "error",
223
+ "symbol-description": "error",
142
224
  "vars-on-top": "off",
143
- "wrap-iife": "off",
144
225
  "yoda": "error",
145
226
 
146
- // Scrict Mode
147
- "strict": "error",
148
-
149
- // Variables
150
- "init-declarations": "off",
151
- "no-delete-var": "error",
152
- "no-label-var": "error",
153
- "no-restricted-globals": "off",
154
- "no-shadow": "off",
155
- "no-shadow-restricted-names": "error",
156
- "no-undef": "off",
157
- "no-undef-init": "error",
158
- "no-undefined": "off",
159
- "no-unused-vars": [
160
- "warn", {
161
- "args": "none"
162
- }
163
- ],
164
- "no-use-before-define": ["error", { "functions": false }],
165
-
166
- // Stylistic Issues
227
+ // Layout & Formatting
167
228
  "array-bracket-newline": ["error", "consistent"],
168
229
  "array-bracket-spacing": ["error", "never"],
169
230
  "array-element-newline": "off",
231
+ "arrow-parens": ["error", "always"],
232
+ "arrow-spacing": "error",
170
233
  "block-spacing": "error",
171
234
  "brace-style": "error",
172
- "camelcase": "off",
173
- "capitalized-comments": "off",
174
235
  "comma-dangle": ["error", "never"],
175
236
  "comma-spacing": ["error", { "before": false, "after": true }],
176
237
  "comma-style": ["error", "last"],
177
238
  "computed-property-spacing": ["error", "never"],
178
- "consistent-this": "off",
239
+ "dot-location": ["error", "property"],
179
240
  "eol-last": ["error", "always"],
180
241
  "func-call-spacing": ["error", "never"],
181
- "func-name-matching": "error",
182
- "func-names": "off",
183
- "func-style": "off",
184
242
  "function-call-argument-newline": "off",
185
243
  "function-paren-newline": "off",
186
- "id-denylist": "off",
187
- "id-length": "off",
188
- "id-match": "off",
189
- "implicit-arrow-linebreak": "off",
244
+ "generator-star-spacing": "error",
245
+ "implicit-arrow-linebreak": "error",
190
246
  "indent": [
191
247
  "error", 4, {
192
248
  "SwitchCase": 1,
@@ -203,60 +259,32 @@ module.exports = {
203
259
  "linebreak-style": "off",
204
260
  "lines-around-comment": "off",
205
261
  "lines-between-class-members": ["error", "always"],
206
- "max-depth": "off",
207
262
  "max-len": "off",
208
- "max-lines": "off",
209
- "max-lines-per-function": "off",
210
- "max-nested-callbacks": "off",
211
- "max-params": "off",
212
- "max-statements": "off",
213
263
  "max-statements-per-line": "off",
214
- "multiline-comment-style": ["warn", "separate-lines"],
215
264
  "multiline-ternary": "off",
216
- "new-cap": "off",
217
265
  "new-parens": "error",
218
266
  "newline-per-chained-call": "off",
219
- "no-array-constructor": "error",
220
- "no-bitwise": "off",
221
- "no-continue": "off",
222
- "no-inline-comments": "off",
223
- "no-lonely-if": "off",
224
- "no-mixed-operators": "off",
267
+ "no-extra-parens": ["error", "functions"],
225
268
  "no-mixed-spaces-and-tabs": "error",
226
- "no-multi-assign": "off",
269
+ "no-multi-spaces": "off",
227
270
  "no-multiple-empty-lines": ["error", { "max": 2, "maxBOF": 0, "maxEOF": 0 }],
228
- "no-negated-condition": "off",
229
- "no-nested-ternary": "off", // upgrade to warn: "warn",
230
- "no-new-object": "error",
231
- "no-plusplus": "off",
232
- "no-restricted-syntax": "error",
233
271
  "no-tabs": "error",
234
- "no-ternary": "off",
235
272
  "no-trailing-spaces": "error",
236
- "no-underscore-dangle": "off",
237
- "no-unneeded-ternary": "error",
238
273
  "no-whitespace-before-property": "error",
239
274
  "nonblock-statement-body-position": "off",
240
275
  "object-curly-newline": ["error", { "consistent": true }],
241
276
  "object-curly-spacing": ["error", "always"],
242
277
  "object-property-newline": ["error", { "allowAllPropertiesOnSameLine": true }],
243
- "one-var": "off",
244
- "one-var-declaration-per-line": "off",
245
- "operator-assignment": ["error", "always"],
246
278
  "operator-linebreak": ["error", "after"],
247
279
  "padded-blocks": ["error", {
248
280
  "classes": "never"
249
281
  }],
250
- "padding-between-statements": "off",
251
- "prefer-exponentiation-operator": "off", // upgrade to warn: "warn",
252
- "prefer-object-spread": "off",
253
- "quote-props": "off", // upgrade to ["warn", "as-needed"],
282
+ "padding-line-between-statements": "off",
254
283
  "quotes": ["off", "single"],
284
+ "rest-spread-spacing": "error",
255
285
  "semi": ["error", "always"],
256
286
  "semi-spacing": [ "error", { "before": false, "after": true } ],
257
287
  "semi-style": ["error", "last"],
258
- "sort-keys": "off", // upgrade to warn
259
- "sort-vars": "off", // upgrade to warn
260
288
  "space-before-blocks": "error",
261
289
  "space-before-function-paren": ["error", { "anonymous": "always", "named": "never" }],
262
290
  "space-in-parens": ["error", "never"],
@@ -266,50 +294,18 @@ module.exports = {
266
294
  }
267
295
  ],
268
296
  "space-unary-ops": [
269
- "off", {
297
+ "error", {
270
298
  "words": true,
271
299
  "nonwords": false,
272
300
  "overrides": {
273
301
  }
274
302
  }],
275
- "spaced-comment": ["error", "always", { "exceptions": ["/"] }],
276
303
  "switch-colon-spacing": ["error", {"after": true, "before": false}],
304
+ "template-curly-spacing": "error",
277
305
  "template-tag-spacing": "error",
278
306
  "unicode-bom": ["error", "never"],
307
+ "wrap-iife": "off",
279
308
  "wrap-regex": "off",
280
-
281
- // ECMAScript 6
282
- "arrow-body-style": "off",
283
- "arrow-parens": ["error", "always"],
284
- "arrow-spacing": "error",
285
- "constructor-super": "error",
286
- "generator-star-spacing": "error",
287
- "no-class-assign": "error",
288
- "no-confusing-arrow": "error",
289
- "no-const-assign": "error",
290
- "no-dupe-class-members": "error",
291
- "no-duplicate-imports": "error",
292
- "no-new-symbol": "error",
293
- "no-restricted-exports": "error",
294
- "no-restricted-imports": "error",
295
- "no-this-before-super": "error",
296
- "no-useless-computed-key": "error",
297
- "no-useless-constructor": "warn", // update to error
298
- "no-useless-rename": "error",
299
- "no-var": "off", // update to error
300
- "object-shorthand": "off",
301
- "prefer-arrow-callback": "off",
302
- "prefer-const": "error",
303
- "prefer-destructuring": "off",
304
- "prefer-numeric-literals": "error",
305
- "prefer-rest-params": "off",
306
- "prefer-spread": "warn",
307
- "prefer-template": "off",
308
- "require-yield": "error",
309
- "rest-spread-spacing": "error",
310
- "sort-imports": "off",
311
- "symbol-description": "error",
312
- "template-curly-spacing": "error",
313
309
  "yield-star-spacing": "error",
314
310
 
315
311
  // JSDoc rules
@@ -317,6 +313,7 @@ module.exports = {
317
313
  "jsdoc/check-alignment": "error",
318
314
  "jsdoc/check-examples": "error",
319
315
  "jsdoc/check-indentation": "off",
316
+ "jsdoc/check-line-alignment": "off",
320
317
  "jsdoc/check-param-names": "off",
321
318
  "jsdoc/check-property-names": "error",
322
319
  "jsdoc/check-syntax": "error",
@@ -330,27 +327,39 @@ module.exports = {
330
327
  "jsdoc/empty-tags": "error",
331
328
  "jsdoc/implements-on-classes": "error",
332
329
  "jsdoc/match-description": "off",
330
+ "jsdoc/match-name": "off",
331
+ "jsdoc/multiline-blocks": "off",
333
332
  "jsdoc/newline-after-description": "error",
334
- "jsdoc/no-types": "off", // Need types on param tags
333
+ "jsdoc/no-bad-blocks": "off",
334
+ "jsdoc/no-defaults": "off",
335
+ "jsdoc/no-missing-syntax": "off",
336
+ "jsdoc/no-multi-asterisks": "off",
337
+ "jsdoc/no-restricted-syntax": "off",
338
+ "jsdoc/no-types": "off",
335
339
  "jsdoc/no-undefined-types": "off",
336
- "jsdoc/require-description": "off",
340
+ "jsdoc/require-asterisk-prefix": "off",
337
341
  "jsdoc/require-description-complete-sentence": "off",
342
+ "jsdoc/require-description": "off",
338
343
  "jsdoc/require-example": "off",
339
344
  "jsdoc/require-file-overview": "off",
340
345
  "jsdoc/require-hyphen-before-param-description": ["error", "always"],
341
346
  "jsdoc/require-jsdoc": "off", // Not everything needs to be documented
342
- "jsdoc/require-param": "error",
343
347
  "jsdoc/require-param-description": "error",
344
348
  "jsdoc/require-param-name": "error",
345
349
  "jsdoc/require-param-type": "error",
350
+ "jsdoc/require-param": "error",
346
351
  "jsdoc/require-property": "error",
347
352
  "jsdoc/require-property-description": "error",
348
353
  "jsdoc/require-property-name": "error",
349
354
  "jsdoc/require-property-type": "error",
350
- "jsdoc/require-returns": "error",
351
355
  "jsdoc/require-returns-check": "error",
352
356
  "jsdoc/require-returns-description": "error",
353
357
  "jsdoc/require-returns-type": "error",
358
+ "jsdoc/require-returns": "error",
359
+ "jsdoc/require-throws": "off",
360
+ "jsdoc/require-yields": "off",
361
+ "jsdoc/require-yields-check": "off",
362
+ "jsdoc/tag-lines": "off",
354
363
  "jsdoc/valid-types": "off"
355
364
  },
356
365
 
@@ -363,4 +372,4 @@ module.exports = {
363
372
  "node": true
364
373
  }
365
374
 
366
- };
375
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playcanvas/eslint-config",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "author": "PlayCanvas <support@playcanvas.com>",
5
5
  "homepage": "https://playcanvas.com",
6
6
  "description": "ESLint configuration used by PlayCanvas",
@@ -26,7 +26,7 @@
26
26
  "README.md"
27
27
  ],
28
28
  "dependencies": {
29
- "eslint-plugin-jsdoc": "^32.3.0"
29
+ "eslint-plugin-jsdoc": "^37.0.0"
30
30
  },
31
31
  "scripts": {
32
32
  "test": "echo \"Error: no test specified\" && exit 1"