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