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