@innovixx/eslint-config 3.0.14 → 4.0.0-alpha.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.
@@ -1,362 +1,360 @@
1
1
  /** @type {import('eslint').Linter.Config} */
2
2
 
3
3
  const bestPracticesRules = {
4
- rules: {
5
- // enforces getter/setter pairs in objects
6
- 'accessor-pairs': 'off',
4
+ rules: {
5
+ // enforces getter/setter pairs in objects
6
+ 'accessor-pairs': 'off',
7
7
 
8
- // enforces return statements in callbacks of array's methods
9
- // https://eslint.org/docs/rules/array-callback-return
10
- 'array-callback-return': ['error', { allowImplicit: true }],
8
+ // enforces return statements in callbacks of array's methods
9
+ // https://eslint.org/docs/rules/array-callback-return
10
+ 'array-callback-return': ['error', { allowImplicit: true }],
11
11
 
12
- // treat var statements as if they were block scoped
13
- 'block-scoped-var': 'error',
12
+ // treat var statements as if they were block scoped
13
+ 'block-scoped-var': 'error',
14
14
 
15
- // specify the maximum cyclomatic complexity allowed in a program
16
- complexity: ['off', 11],
15
+ // specify the maximum cyclomatic complexity allowed in a program
16
+ complexity: ['off', 11],
17
17
 
18
- // enforce that class methods use "this"
19
- // https://eslint.org/docs/rules/class-methods-use-this
20
- 'class-methods-use-this': ['error', {
21
- exceptMethods: [],
22
- }],
18
+ // enforce that class methods use "this"
19
+ // https://eslint.org/docs/rules/class-methods-use-this
20
+ 'class-methods-use-this': ['error', {
21
+ exceptMethods: [],
22
+ }],
23
23
 
24
- // require return statements to either always or never specify values
25
- 'consistent-return': 'error',
24
+ // require return statements to either always or never specify values
25
+ 'consistent-return': 'error',
26
26
 
27
- // specify curly brace conventions for all control statements
28
- curly: ['error', 'multi-line'], // multiline
27
+ // specify curly brace conventions for all control statements
28
+ curly: ['error', 'multi-line'], // multiline
29
29
 
30
- // require default case in switch statements
31
- 'default-case': ['error', { commentPattern: '^no default$' }],
32
-
33
- // https://eslint.org/docs/rules/default-param-last
34
- // TODO: enable, semver-minor, when eslint v6.4 is required (which is a major)
35
- 'default-param-last': 'off',
36
-
37
- // encourages use of dot notation whenever possible
38
- 'dot-notation': ['error', { allowKeywords: true }],
39
-
40
- // enforces consistent newlines before or after dots
41
- // https://eslint.org/docs/rules/dot-location
42
- 'dot-location': ['error', 'property'],
30
+ // require default case in switch statements
31
+ 'default-case': ['error', { commentPattern: '^no default$' }],
32
+
33
+ // https://eslint.org/docs/rules/default-param-last
34
+ // TODO: enable, semver-minor, when eslint v6.4 is required (which is a major)
35
+ 'default-param-last': 'off',
36
+
37
+ // encourages use of dot notation whenever possible
38
+ 'dot-notation': ['error', { allowKeywords: true }],
39
+
40
+ // enforces consistent newlines before or after dots
41
+ // https://eslint.org/docs/rules/dot-location
42
+ 'dot-location': ['error', 'property'],
43
43
 
44
- // require the use of === and !==
45
- // https://eslint.org/docs/rules/eqeqeq
46
- eqeqeq: ['error', 'always', { null: 'ignore' }],
44
+ // require the use of === and !==
45
+ // https://eslint.org/docs/rules/eqeqeq
46
+ eqeqeq: ['error', 'always', { null: 'ignore' }],
47
47
 
48
- // Require grouped accessor pairs in object literals and classes
49
- // https://eslint.org/docs/rules/grouped-accessor-pairs
50
- // TODO: enable in next major, altho the guide forbids getters/setters anyways
51
- 'grouped-accessor-pairs': 'off',
48
+ // Require grouped accessor pairs in object literals and classes
49
+ // https://eslint.org/docs/rules/grouped-accessor-pairs
50
+ // TODO: enable in next major, altho the guide forbids getters/setters anyways
51
+ 'grouped-accessor-pairs': 'off',
52
52
 
53
- // make sure for-in loops have an if statement
54
- 'guard-for-in': 'error',
53
+ // make sure for-in loops have an if statement
54
+ 'guard-for-in': 'error',
55
55
 
56
- // enforce a maximum number of classes per file
57
- // https://eslint.org/docs/rules/max-classes-per-file
58
- 'max-classes-per-file': ['error', 1],
56
+ // enforce a maximum number of classes per file
57
+ // https://eslint.org/docs/rules/max-classes-per-file
58
+ 'max-classes-per-file': ['error', 1],
59
59
 
60
- // disallow the use of alert, confirm, and prompt
61
- 'no-alert': 'warn',
60
+ // disallow the use of alert, confirm, and prompt
61
+ 'no-alert': 'warn',
62
62
 
63
- // disallow use of arguments.caller or arguments.callee
64
- 'no-caller': 'error',
63
+ // disallow use of arguments.caller or arguments.callee
64
+ 'no-caller': 'error',
65
65
 
66
- // disallow lexical declarations in case/default clauses
67
- // https://eslint.org/docs/rules/no-case-declarations.html
68
- 'no-case-declarations': 'error',
66
+ // disallow lexical declarations in case/default clauses
67
+ // https://eslint.org/docs/rules/no-case-declarations.html
68
+ 'no-case-declarations': 'error',
69
69
 
70
- // Disallow returning value in constructor
71
- // https://eslint.org/docs/rules/no-constructor-return
72
- // TODO: enable, semver-major
73
- 'no-constructor-return': 'off',
70
+ // Disallow returning value in constructor
71
+ // https://eslint.org/docs/rules/no-constructor-return
72
+ // TODO: enable, semver-major
73
+ 'no-constructor-return': 'off',
74
74
 
75
- // disallow division operators explicitly at beginning of regular expression
76
- // https://eslint.org/docs/rules/no-div-regex
77
- 'no-div-regex': 'off',
75
+ // disallow division operators explicitly at beginning of regular expression
76
+ // https://eslint.org/docs/rules/no-div-regex
77
+ 'no-div-regex': 'off',
78
78
 
79
- // disallow else after a return in an if
80
- // https://eslint.org/docs/rules/no-else-return
81
- 'no-else-return': ['error', { allowElseIf: false }],
79
+ // disallow else after a return in an if
80
+ // https://eslint.org/docs/rules/no-else-return
81
+ 'no-else-return': ['error', { allowElseIf: false }],
82
82
 
83
- // disallow empty functions, except for standalone funcs/arrows
84
- // https://eslint.org/docs/rules/no-empty-function
85
- 'no-empty-function': ['error', {
86
- allow: [
87
- 'arrowFunctions',
88
- 'functions',
89
- 'methods',
90
- ],
91
- }],
83
+ // disallow empty functions, except for standalone funcs/arrows
84
+ // https://eslint.org/docs/rules/no-empty-function
85
+ 'no-empty-function': ['error', {
86
+ allow: [
87
+ 'arrowFunctions',
88
+ 'functions',
89
+ 'methods',
90
+ ],
91
+ }],
92
92
 
93
- // disallow empty destructuring patterns
94
- // https://eslint.org/docs/rules/no-empty-pattern
95
- 'no-empty-pattern': 'error',
96
-
97
- // disallow comparisons to null without a type-checking operator
98
- 'no-eq-null': 'off',
99
-
100
- // disallow use of eval()
101
- 'no-eval': 'error',
102
-
103
- // disallow adding to native types
104
- 'no-extend-native': 'error',
105
-
106
- // disallow unnecessary function binding
107
- 'no-extra-bind': 'error',
108
-
109
- // disallow Unnecessary Labels
110
- // https://eslint.org/docs/rules/no-extra-label
111
- 'no-extra-label': 'error',
112
-
113
- // disallow fallthrough of case statements
114
- 'no-fallthrough': 'error',
115
-
116
- // disallow the use of leading or trailing decimal points in numeric literals
117
- 'no-floating-decimal': 'error',
118
-
119
- // disallow reassignments of native objects or read-only globals
120
- // https://eslint.org/docs/rules/no-global-assign
121
- 'no-global-assign': ['error', { exceptions: [] }],
122
- // deprecated in favor of no-global-assign
123
- 'no-native-reassign': 'off',
124
-
125
- // disallow implicit type conversions
126
- // https://eslint.org/docs/rules/no-implicit-coercion
127
- 'no-implicit-coercion': ['off', {
128
- boolean: false,
129
- number: true,
130
- string: true,
131
- allow: [],
132
- }],
133
-
134
- // disallow var and named functions in global scope
135
- // https://eslint.org/docs/rules/no-implicit-globals
136
- 'no-implicit-globals': 'off',
137
-
138
- // disallow use of eval()-like methods
139
- 'no-implied-eval': 'error',
140
-
141
- // disallow this keywords outside of classes or class-like objects
142
- 'no-invalid-this': 'off',
143
-
144
- // disallow usage of __iterator__ property
145
- 'no-iterator': 'error',
146
-
147
- // disallow use of labels for anything other then loops and switches
148
- 'no-labels': ['error', { allowLoop: false, allowSwitch: false }],
149
-
150
- // disallow unnecessary nested blocks
151
- 'no-lone-blocks': 'error',
152
-
153
- // disallow creation of functions within loops
154
- 'no-loop-func': 'error',
155
-
156
- // disallow magic numbers
157
- // https://eslint.org/docs/rules/no-magic-numbers
158
- 'no-magic-numbers': ['off', {
159
- ignore: [],
160
- ignoreArrayIndexes: true,
161
- enforceConst: true,
162
- detectObjects: false,
163
- }],
164
-
165
- // disallow use of multiple spaces
166
- 'no-multi-spaces': ['error', {
167
- ignoreEOLComments: false,
168
- }],
169
-
170
- // disallow use of multiline strings
171
- 'no-multi-str': 'error',
172
-
173
- // disallow use of new operator when not part of the assignment or comparison
174
- 'no-new': 'error',
175
-
176
- // disallow use of new operator for Function object
177
- 'no-new-func': 'error',
178
-
179
- // disallows creating new instances of String, Number, and Boolean
180
- 'no-new-wrappers': 'error',
181
-
182
- // disallow use of (old style) octal literals
183
- 'no-octal': 'error',
184
-
185
- // disallow use of octal escape sequences in string literals, such as
186
- // var foo = 'Copyright \251';
187
- 'no-octal-escape': 'error',
188
-
189
- // disallow reassignment of function parameters
190
- // disallow parameter object manipulation except for specific exclusions
191
- // rule: https://eslint.org/docs/rules/no-param-reassign.html
192
- 'no-param-reassign': ['error', {
193
- props: true,
194
- ignorePropertyModificationsFor: [
195
- 'acc', // for reduce accumulators
196
- 'accumulator', // for reduce accumulators
197
- 'e', // for e.returnvalue
198
- 'ctx', // for Koa routing
199
- 'req', // for Express requests
200
- 'request', // for Express requests
201
- 'res', // for Express responses
202
- 'response', // for Express responses
203
- '$scope', // for Angular 1 scopes
204
- 'staticContext', // for ReactRouter context
205
- ],
206
- }],
207
-
208
- // disallow usage of __proto__ property
209
- 'no-proto': 'error',
210
-
211
- // disallow declaring the same variable more then once
212
- 'no-redeclare': 'error',
213
-
214
- // disallow certain object properties
215
- // https://eslint.org/docs/rules/no-restricted-properties
216
- 'no-restricted-properties': ['error',
217
- {
218
- object: 'arguments',
219
- property: 'callee',
220
- message: 'arguments.callee is deprecated',
221
- }, {
222
- object: 'global',
223
- property: 'isFinite',
224
- message: 'Please use Number.isFinite instead',
225
- }, {
226
- object: 'self',
227
- property: 'isFinite',
228
- message: 'Please use Number.isFinite instead',
229
- }, {
230
- object: 'window',
231
- property: 'isFinite',
232
- message: 'Please use Number.isFinite instead',
233
- }, {
234
- object: 'global',
235
- property: 'isNaN',
236
- message: 'Please use Number.isNaN instead',
237
- }, {
238
- object: 'self',
239
- property: 'isNaN',
240
- message: 'Please use Number.isNaN instead',
241
- }, {
242
- object: 'window',
243
- property: 'isNaN',
244
- message: 'Please use Number.isNaN instead',
245
- }, {
246
- property: '__defineGetter__',
247
- message: 'Please use Object.defineProperty instead.',
248
- }, {
249
- property: '__defineSetter__',
250
- message: 'Please use Object.defineProperty instead.',
251
- }, {
252
- object: 'Math',
253
- property: 'pow',
254
- message: 'Use the exponentiation operator (**) instead.',
255
- }],
256
-
257
- // disallow use of assignment in return statement
258
- 'no-return-assign': ['error', 'always'],
259
-
260
- // disallow redundant `return await`
261
- 'no-return-await': 'error',
262
-
263
- // disallow use of `javascript:` urls.
264
- 'no-script-url': 'error',
265
-
266
- // disallow self assignment
267
- // https://eslint.org/docs/rules/no-self-assign
268
- 'no-self-assign': ['error', {
269
- props: true,
270
- }],
271
-
272
- // disallow comparisons where both sides are exactly the same
273
- 'no-self-compare': 'error',
274
-
275
- // disallow use of comma operator
276
- 'no-sequences': 'error',
277
-
278
- // restrict what can be thrown as an exception
279
- 'no-throw-literal': 'error',
280
-
281
- // disallow unmodified conditions of loops
282
- // https://eslint.org/docs/rules/no-unmodified-loop-condition
283
- 'no-unmodified-loop-condition': 'off',
284
-
285
- // disallow usage of expressions in statement position
286
- 'no-unused-expressions': ['error', {
287
- allowShortCircuit: false,
288
- allowTernary: false,
289
- allowTaggedTemplates: false,
290
- }],
291
-
292
- // disallow unused labels
293
- // https://eslint.org/docs/rules/no-unused-labels
294
- 'no-unused-labels': 'error',
295
-
296
- // disallow unnecessary .call() and .apply()
297
- 'no-useless-call': 'off',
298
-
299
- // Disallow unnecessary catch clauses
300
- // https://eslint.org/docs/rules/no-useless-catch
301
- 'no-useless-catch': 'error',
302
-
303
- // disallow useless string concatenation
304
- // https://eslint.org/docs/rules/no-useless-concat
305
- 'no-useless-concat': 'error',
306
-
307
- // disallow unnecessary string escaping
308
- // https://eslint.org/docs/rules/no-useless-escape
309
- 'no-useless-escape': 'error',
310
-
311
- // disallow redundant return; keywords
312
- // https://eslint.org/docs/rules/no-useless-return
313
- 'no-useless-return': 'error',
314
-
315
- // disallow use of void operator
316
- // https://eslint.org/docs/rules/no-void
317
- 'no-void': 'error',
318
-
319
- // disallow usage of configurable warning terms in comments: e.g. todo
320
- 'no-warning-comments': ['off', { terms: ['todo', 'fixme', 'xxx'], location: 'start' }],
321
-
322
- // disallow use of the with statement
323
- 'no-with': 'error',
324
-
325
- // require using Error objects as Promise rejection reasons
326
- // https://eslint.org/docs/rules/prefer-promise-reject-errors
327
- 'prefer-promise-reject-errors': ['error', { allowEmptyReject: true }],
328
-
329
- // Suggest using named capture group in regular expression
330
- // https://eslint.org/docs/rules/prefer-named-capture-group
331
- 'prefer-named-capture-group': 'off',
332
-
333
- // https://eslint.org/docs/rules/prefer-regex-literals
334
- // TODO; enable, semver-minor, once eslint v6.4 is required (which is a major)
335
- 'prefer-regex-literals': 'off',
336
-
337
- // require use of the second argument for parseInt()
338
- radix: 'error',
339
-
340
- // require `await` in `async function` (note: this is a horrible rule that should never be used)
341
- // https://eslint.org/docs/rules/require-await
342
- 'require-await': 'off',
343
-
344
- // Enforce the use of u flag on RegExp
345
- // https://eslint.org/docs/rules/require-unicode-regexp
346
- 'require-unicode-regexp': 'off',
93
+ // disallow empty destructuring patterns
94
+ // https://eslint.org/docs/rules/no-empty-pattern
95
+ 'no-empty-pattern': 'error',
96
+
97
+ // disallow comparisons to null without a type-checking operator
98
+ 'no-eq-null': 'off',
99
+
100
+ // disallow use of eval()
101
+ 'no-eval': 'error',
102
+
103
+ // disallow adding to native types
104
+ 'no-extend-native': 'error',
105
+
106
+ // disallow unnecessary function binding
107
+ 'no-extra-bind': 'error',
108
+
109
+ // disallow Unnecessary Labels
110
+ // https://eslint.org/docs/rules/no-extra-label
111
+ 'no-extra-label': 'error',
112
+
113
+ // disallow fallthrough of case statements
114
+ 'no-fallthrough': 'error',
115
+
116
+ // disallow the use of leading or trailing decimal points in numeric literals
117
+ 'no-floating-decimal': 'error',
118
+
119
+ // disallow reassignments of native objects or read-only globals
120
+ // https://eslint.org/docs/rules/no-global-assign
121
+ 'no-global-assign': ['error', { exceptions: [] }],
122
+ // deprecated in favor of no-global-assign
123
+ 'no-native-reassign': 'off',
124
+
125
+ // disallow implicit type conversions
126
+ // https://eslint.org/docs/rules/no-implicit-coercion
127
+ 'no-implicit-coercion': ['off', {
128
+ boolean: false,
129
+ number: true,
130
+ string: true,
131
+ allow: [],
132
+ }],
133
+
134
+ // disallow var and named functions in global scope
135
+ // https://eslint.org/docs/rules/no-implicit-globals
136
+ 'no-implicit-globals': 'off',
137
+
138
+ // disallow use of eval()-like methods
139
+ 'no-implied-eval': 'error',
140
+
141
+ // disallow this keywords outside of classes or class-like objects
142
+ 'no-invalid-this': 'off',
143
+
144
+ // disallow usage of __iterator__ property
145
+ 'no-iterator': 'error',
146
+
147
+ // disallow use of labels for anything other then loops and switches
148
+ 'no-labels': ['error', { allowLoop: false, allowSwitch: false }],
149
+
150
+ // disallow unnecessary nested blocks
151
+ 'no-lone-blocks': 'error',
152
+
153
+ // disallow creation of functions within loops
154
+ 'no-loop-func': 'error',
155
+
156
+ // disallow magic numbers
157
+ // https://eslint.org/docs/rules/no-magic-numbers
158
+ 'no-magic-numbers': ['off', {
159
+ ignore: [],
160
+ ignoreArrayIndexes: true,
161
+ enforceConst: true,
162
+ detectObjects: false,
163
+ }],
164
+
165
+ // disallow use of multiple spaces
166
+ 'no-multi-spaces': 'off',
167
+
168
+ // disallow use of multiline strings
169
+ 'no-multi-str': 'error',
170
+
171
+ // disallow use of new operator when not part of the assignment or comparison
172
+ 'no-new': 'error',
173
+
174
+ // disallow use of new operator for Function object
175
+ 'no-new-func': 'error',
176
+
177
+ // disallows creating new instances of String, Number, and Boolean
178
+ 'no-new-wrappers': 'error',
179
+
180
+ // disallow use of (old style) octal literals
181
+ 'no-octal': 'error',
182
+
183
+ // disallow use of octal escape sequences in string literals, such as
184
+ // var foo = 'Copyright \251';
185
+ 'no-octal-escape': 'error',
186
+
187
+ // disallow reassignment of function parameters
188
+ // disallow parameter object manipulation except for specific exclusions
189
+ // rule: https://eslint.org/docs/rules/no-param-reassign.html
190
+ 'no-param-reassign': ['error', {
191
+ props: true,
192
+ ignorePropertyModificationsFor: [
193
+ 'acc', // for reduce accumulators
194
+ 'accumulator', // for reduce accumulators
195
+ 'e', // for e.returnvalue
196
+ 'ctx', // for Koa routing
197
+ 'req', // for Express requests
198
+ 'request', // for Express requests
199
+ 'res', // for Express responses
200
+ 'response', // for Express responses
201
+ '$scope', // for Angular 1 scopes
202
+ 'staticContext', // for ReactRouter context
203
+ ],
204
+ }],
205
+
206
+ // disallow usage of __proto__ property
207
+ 'no-proto': 'error',
208
+
209
+ // disallow declaring the same variable more then once
210
+ 'no-redeclare': 'error',
211
+
212
+ // disallow certain object properties
213
+ // https://eslint.org/docs/rules/no-restricted-properties
214
+ 'no-restricted-properties': ['error',
215
+ {
216
+ object: 'arguments',
217
+ property: 'callee',
218
+ message: 'arguments.callee is deprecated',
219
+ }, {
220
+ object: 'global',
221
+ property: 'isFinite',
222
+ message: 'Please use Number.isFinite instead',
223
+ }, {
224
+ object: 'self',
225
+ property: 'isFinite',
226
+ message: 'Please use Number.isFinite instead',
227
+ }, {
228
+ object: 'window',
229
+ property: 'isFinite',
230
+ message: 'Please use Number.isFinite instead',
231
+ }, {
232
+ object: 'global',
233
+ property: 'isNaN',
234
+ message: 'Please use Number.isNaN instead',
235
+ }, {
236
+ object: 'self',
237
+ property: 'isNaN',
238
+ message: 'Please use Number.isNaN instead',
239
+ }, {
240
+ object: 'window',
241
+ property: 'isNaN',
242
+ message: 'Please use Number.isNaN instead',
243
+ }, {
244
+ property: '__defineGetter__',
245
+ message: 'Please use Object.defineProperty instead.',
246
+ }, {
247
+ property: '__defineSetter__',
248
+ message: 'Please use Object.defineProperty instead.',
249
+ }, {
250
+ object: 'Math',
251
+ property: 'pow',
252
+ message: 'Use the exponentiation operator (**) instead.',
253
+ }],
254
+
255
+ // disallow use of assignment in return statement
256
+ 'no-return-assign': ['error', 'always'],
257
+
258
+ // disallow redundant `return await`
259
+ 'no-return-await': 'error',
260
+
261
+ // disallow use of `javascript:` urls.
262
+ 'no-script-url': 'error',
263
+
264
+ // disallow self assignment
265
+ // https://eslint.org/docs/rules/no-self-assign
266
+ 'no-self-assign': ['error', {
267
+ props: true,
268
+ }],
269
+
270
+ // disallow comparisons where both sides are exactly the same
271
+ 'no-self-compare': 'error',
272
+
273
+ // disallow use of comma operator
274
+ 'no-sequences': 'error',
275
+
276
+ // restrict what can be thrown as an exception
277
+ 'no-throw-literal': 'error',
278
+
279
+ // disallow unmodified conditions of loops
280
+ // https://eslint.org/docs/rules/no-unmodified-loop-condition
281
+ 'no-unmodified-loop-condition': 'off',
282
+
283
+ // disallow usage of expressions in statement position
284
+ 'no-unused-expressions': ['error', {
285
+ allowShortCircuit: false,
286
+ allowTernary: false,
287
+ allowTaggedTemplates: false,
288
+ }],
289
+
290
+ // disallow unused labels
291
+ // https://eslint.org/docs/rules/no-unused-labels
292
+ 'no-unused-labels': 'error',
293
+
294
+ // disallow unnecessary .call() and .apply()
295
+ 'no-useless-call': 'off',
296
+
297
+ // Disallow unnecessary catch clauses
298
+ // https://eslint.org/docs/rules/no-useless-catch
299
+ 'no-useless-catch': 'error',
300
+
301
+ // disallow useless string concatenation
302
+ // https://eslint.org/docs/rules/no-useless-concat
303
+ 'no-useless-concat': 'error',
304
+
305
+ // disallow unnecessary string escaping
306
+ // https://eslint.org/docs/rules/no-useless-escape
307
+ 'no-useless-escape': 'error',
308
+
309
+ // disallow redundant return; keywords
310
+ // https://eslint.org/docs/rules/no-useless-return
311
+ 'no-useless-return': 'error',
312
+
313
+ // disallow use of void operator
314
+ // https://eslint.org/docs/rules/no-void
315
+ 'no-void': 'error',
316
+
317
+ // disallow usage of configurable warning terms in comments: e.g. todo
318
+ 'no-warning-comments': ['off', { terms: ['todo', 'fixme', 'xxx'], location: 'start' }],
319
+
320
+ // disallow use of the with statement
321
+ 'no-with': 'error',
322
+
323
+ // require using Error objects as Promise rejection reasons
324
+ // https://eslint.org/docs/rules/prefer-promise-reject-errors
325
+ 'prefer-promise-reject-errors': ['error', { allowEmptyReject: true }],
326
+
327
+ // Suggest using named capture group in regular expression
328
+ // https://eslint.org/docs/rules/prefer-named-capture-group
329
+ 'prefer-named-capture-group': 'off',
330
+
331
+ // https://eslint.org/docs/rules/prefer-regex-literals
332
+ // TODO; enable, semver-minor, once eslint v6.4 is required (which is a major)
333
+ 'prefer-regex-literals': 'off',
334
+
335
+ // require use of the second argument for parseInt()
336
+ radix: 'error',
337
+
338
+ // require `await` in `async function` (note: this is a horrible rule that should never be used)
339
+ // https://eslint.org/docs/rules/require-await
340
+ 'require-await': 'off',
341
+
342
+ // Enforce the use of u flag on RegExp
343
+ // https://eslint.org/docs/rules/require-unicode-regexp
344
+ 'require-unicode-regexp': 'off',
347
345
 
348
- 'sort-export-all/sort-export-all': 'warn',
346
+ 'sort-export-all/sort-export-all': 'warn',
349
347
 
350
- // requires to declare all vars on top of their containing scope
351
- 'vars-on-top': 'error',
348
+ // requires to declare all vars on top of their containing scope
349
+ 'vars-on-top': 'error',
352
350
 
353
- // require immediate function invocation to be wrapped in parentheses
354
- // https://eslint.org/docs/rules/wrap-iife.html
355
- 'wrap-iife': ['error', 'outside', { functionPrototypeMethods: false }],
351
+ // require immediate function invocation to be wrapped in parentheses
352
+ // https://eslint.org/docs/rules/wrap-iife.html
353
+ 'wrap-iife': ['error', 'outside', { functionPrototypeMethods: false }],
356
354
 
357
- // require or disallow Yoda conditions
358
- yoda: 'error',
359
- },
355
+ // require or disallow Yoda conditions
356
+ yoda: 'error',
357
+ },
360
358
  };
361
359
 
362
360
  export default bestPracticesRules;