@spscommerce/eslint-config-typescript 0.0.2 → 0.0.3

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,330 +1,508 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.bestPractices = void 0;
4
+ // ✅ = recommended, 🔧 = fixable
4
5
  exports.bestPractices = {
5
- /** enforces getter/setter pairs in objects
6
- * https://eslint.org/docs/rules/accessor-pairs
7
- * Off because getters and setters are forbidden */
8
- 'accessor-pairs': 'off',
9
- /** enforces return statements in callbacks of array's methods
10
- * https://eslint.org/docs/rules/array-callback-return */
11
- 'array-callback-return': ['error', { allowImplicit: true }],
12
- /** treat var statements as if they were block scoped
13
- * https://eslint.org/docs/rules/block-scoped-var
14
- * Off because `var` is forbidden */
15
- 'block-scoped-var': 'off',
16
- /** specify the maximum cyclomatic complexity allowed in a program
17
- * https://eslint.org/docs/rules/complexity */
18
- complexity: 'off',
19
- /** enforce that class methods use "this"
20
- * https://eslint.org/docs/rules/class-methods-use-this */
21
- 'class-methods-use-this': 'error',
22
- /** require return statements to either always or never specify values
23
- * https://eslint.org/docs/rules/consistent-return */
24
- 'consistent-return': 'off',
25
- /** specify curly brace conventions for all control statements
26
- * https://eslint.org/docs/rules/curly */
27
- curly: ['error', 'multi-line'],
28
- /** require default case in switch statements
29
- * https://eslint.org/docs/rules/default-case */
30
- 'default-case': ['error', { commentPattern: '^no default$' }],
31
- /** Enforce default clauses in switch statements to be last
32
- * https://eslint.org/docs/rules/default-case-last */
33
- 'default-case-last': 'error',
34
- /** enforce default parameters to be last
35
- * https://eslint.org/docs/rules/default-param-last
36
- * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/default-param-last.md */
37
- 'default-param-last': 'off',
38
- '@typescript-eslint/default-param-last': 'error',
39
- /** enforces consistent newlines before or after dots
40
- * https://eslint.org/docs/rules/dot-location */
41
- 'dot-location': ['error', 'property'],
42
- /** encourages use of dot notation whenever possible
43
- * https://eslint.org/docs/rules/dot-notation
44
- * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/dot-notation.md */
45
- 'dot-notation': 'off',
46
- '@typescript-eslint/dot-notation': ['error', { allowKeywords: true }],
47
- /** require the use of === and !==
48
- * https://eslint.org/docs/rules/eqeqeq */
49
- eqeqeq: 'error',
50
- /** Require grouped accessor pairs in object literals and classes
51
- * https://eslint.org/docs/rules/grouped-accessor-pairs
52
- * Off because getters and setters are forbidden */
53
- 'grouped-accessor-pairs': 'off',
54
- /** make sure for-in loops have an if statement
55
- * https://eslint.org/docs/rules/guard-for-in
56
- * Off because for-in is forbidden */
57
- 'guard-for-in': 'off',
58
- /** enforce a maximum number of classes per file
59
- * https://eslint.org/docs/rules/max-classes-per-file */
60
- 'max-classes-per-file': ['error', 1],
61
- /** disallow the use of alert, confirm, and prompt
62
- * https://eslint.org/docs/rules/no-alert */
63
- 'no-alert': 'error',
64
- /** disallow use of arguments.caller or arguments.callee
65
- * https://eslint.org/docs/rules/no-caller */
66
- 'no-caller': 'error',
67
- /** disallow lexical declarations in case/default clauses
68
- * https://eslint.org/docs/rules/no-case-declarations */
69
- 'no-case-declarations': 'error',
70
- /** Disallow returning value in constructor
71
- * https://eslint.org/docs/rules/no-constructor-return */
72
- 'no-constructor-return': 'error',
73
- /** disallow division operators explicitly at beginning of regular expression
74
- * https://eslint.org/docs/rules/no-div-regex */
75
- 'no-div-regex': 'off',
76
- /** disallow else after a return in an if
77
- * https://eslint.org/docs/rules/no-else-return */
78
- 'no-else-return': 'off',
79
- /** disallow empty functions
80
- * https://eslint.org/docs/rules/no-empty-function
81
- * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-empty-function.md */
82
- 'no-empty-function': 'off',
83
- '@typescript-eslint/no-empty-function': 'off',
84
- /** disallow empty destructuring patterns
85
- * https://eslint.org/docs/rules/no-empty-pattern */
86
- 'no-empty-pattern': 'error',
87
- /** disallow comparisons to null without a type-checking operator
88
- * https://eslint.org/docs/rules/no-eq-null
89
- * Off because it's superceded by eqeqeq */
90
- 'no-eq-null': 'off',
91
- /** disallow use of eval()
92
- * https://eslint.org/docs/rules/no-eval */
93
- 'no-eval': 'error',
94
- /** disallow adding to native types
95
- * https://eslint.org/docs/rules/no-extend-native */
96
- 'no-extend-native': 'error',
97
- /** disallow unnecessary function binding
98
- * https://eslint.org/docs/rules/no-extra-bind */
99
- 'no-extra-bind': 'error',
100
- /** disallow Unnecessary Labels
101
- * https://eslint.org/docs/rules/no-extra-label */
102
- 'no-extra-label': 'error',
103
- /** disallow fallthrough of case statements
104
- * https://eslint.org/docs/rules/no-fallthrough */
105
- 'no-fallthrough': 'error',
106
- /** disallow the use of leading or trailing decimal points in numeric literals
107
- * https://eslint.org/docs/rules/no-floating-decimal */
108
- 'no-floating-decimal': 'error',
109
- /** disallow reassignments of native objects or read-only globals
110
- * https://eslint.org/docs/rules/no-global-assign */
111
- 'no-global-assign': 'error',
112
- /** disallow implicit type conversions
113
- * https://eslint.org/docs/rules/no-implicit-coercion */
114
- 'no-implicit-coercion': [
115
- 'error',
6
+ /**
7
+ * enforces getter/setter pairs in objects
8
+ * https://eslint.org/docs/rules/accessor-pairs
9
+ * Off because getters and setters are forbidden
10
+ */
11
+ "accessor-pairs": "off",
12
+ /**
13
+ * enforces return statements in callbacks of array's methods
14
+ * https://eslint.org/docs/rules/array-callback-return
15
+ */
16
+ "array-callback-return": ["error", { allowImplicit: true }],
17
+ /**
18
+ * treat var statements as if they were block scoped
19
+ * https://eslint.org/docs/rules/block-scoped-var
20
+ * Off because `var` is forbidden
21
+ */
22
+ "block-scoped-var": "off",
23
+ /**
24
+ * specify the maximum cyclomatic complexity allowed in a program
25
+ * https://eslint.org/docs/rules/complexity
26
+ */
27
+ complexity: "off",
28
+ /**
29
+ * enforce that class methods use "this"
30
+ * https://eslint.org/docs/rules/class-methods-use-this
31
+ */
32
+ "class-methods-use-this": "error",
33
+ /**
34
+ * require return statements to either always or never specify values
35
+ * https://eslint.org/docs/rules/consistent-return
36
+ */
37
+ "consistent-return": "off",
38
+ /**
39
+ * specify curly brace conventions for all control statements 🔧
40
+ * https://eslint.org/docs/rules/curly
41
+ */
42
+ curly: ["error", "multi-line"],
43
+ /**
44
+ * require default case in switch statements
45
+ * https://eslint.org/docs/rules/default-case
46
+ */
47
+ "default-case": ["error", { commentPattern: "^no default$" }],
48
+ /**
49
+ * Enforce default clauses in switch statements to be last
50
+ * https://eslint.org/docs/rules/default-case-last
51
+ */
52
+ "default-case-last": "error",
53
+ /**
54
+ * enforce default parameters to be last
55
+ * https://eslint.org/docs/rules/default-param-last
56
+ * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/default-param-last.md
57
+ */
58
+ "default-param-last": "off",
59
+ "@typescript-eslint/default-param-last": "error",
60
+ /**
61
+ * enforces consistent newlines before or after dots
62
+ * https://eslint.org/docs/rules/dot-location
63
+ */
64
+ "dot-location": ["error", "property"],
65
+ /**
66
+ * encourages use of dot notation whenever possible 🔧
67
+ * https://eslint.org/docs/rules/dot-notation
68
+ * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/dot-notation.md
69
+ */
70
+ "dot-notation": "off",
71
+ "@typescript-eslint/dot-notation": ["error", { allowKeywords: true }],
72
+ /**
73
+ * require the use of === and !== 🔧
74
+ * https://eslint.org/docs/rules/eqeqeq
75
+ */
76
+ eqeqeq: "error",
77
+ /**
78
+ * Require grouped accessor pairs in object literals and classes
79
+ * https://eslint.org/docs/rules/grouped-accessor-pairs
80
+ * Off because getters and setters are forbidden
81
+ */
82
+ "grouped-accessor-pairs": "off",
83
+ /**
84
+ * make sure for-in loops have an if statement
85
+ * https://eslint.org/docs/rules/guard-for-in
86
+ * Off because for-in is forbidden
87
+ */
88
+ "guard-for-in": "off",
89
+ /**
90
+ * enforce a maximum number of classes per file
91
+ * https://eslint.org/docs/rules/max-classes-per-file
92
+ */
93
+ "max-classes-per-file": ["error", 1],
94
+ /**
95
+ * disallow the use of alert, confirm, and prompt
96
+ * https://eslint.org/docs/rules/no-alert
97
+ */
98
+ "no-alert": "error",
99
+ /**
100
+ * disallow use of arguments.caller or arguments.callee
101
+ * https://eslint.org/docs/rules/no-caller
102
+ */
103
+ "no-caller": "error",
104
+ /**
105
+ * disallow lexical declarations in case/default clauses ✅
106
+ * https://eslint.org/docs/rules/no-case-declarations
107
+ */
108
+ "no-case-declarations": "error",
109
+ /**
110
+ * Disallow returning value in constructor
111
+ * https://eslint.org/docs/rules/no-constructor-return
112
+ */
113
+ "no-constructor-return": "error",
114
+ /**
115
+ * disallow division operators explicitly at beginning of regular expression 🔧
116
+ * https://eslint.org/docs/rules/no-div-regex
117
+ */
118
+ "no-div-regex": "off",
119
+ /**
120
+ * disallow else after a return in an if 🔧
121
+ * https://eslint.org/docs/rules/no-else-return
122
+ */
123
+ "no-else-return": "off",
124
+ /**
125
+ * disallow empty functions
126
+ * https://eslint.org/docs/rules/no-empty-function
127
+ * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-empty-function.md
128
+ */
129
+ "no-empty-function": "off",
130
+ "@typescript-eslint/no-empty-function": "off",
131
+ /**
132
+ * disallow empty destructuring patterns ✅
133
+ * https://eslint.org/docs/rules/no-empty-pattern
134
+ */
135
+ "no-empty-pattern": "error",
136
+ /**
137
+ * disallow comparisons to null without a type-checking operator
138
+ * https://eslint.org/docs/rules/no-eq-null
139
+ * Off because it's superceded by eqeqeq
140
+ */
141
+ "no-eq-null": "off",
142
+ /**
143
+ * disallow use of eval()
144
+ * https://eslint.org/docs/rules/no-eval
145
+ */
146
+ "no-eval": "error",
147
+ /**
148
+ * disallow adding to native types
149
+ * https://eslint.org/docs/rules/no-extend-native
150
+ */
151
+ "no-extend-native": "error",
152
+ /**
153
+ * disallow unnecessary function binding 🔧
154
+ * https://eslint.org/docs/rules/no-extra-bind
155
+ */
156
+ "no-extra-bind": "error",
157
+ /**
158
+ * disallow Unnecessary Labels 🔧
159
+ * https://eslint.org/docs/rules/no-extra-label
160
+ */
161
+ "no-extra-label": "error",
162
+ /**
163
+ * disallow fallthrough of case statements ✅
164
+ * https://eslint.org/docs/rules/no-fallthrough
165
+ */
166
+ "no-fallthrough": "error",
167
+ /**
168
+ * disallow the use of leading or trailing decimal points in numeric literals 🔧
169
+ * https://eslint.org/docs/rules/no-floating-decimal
170
+ */
171
+ "no-floating-decimal": "error",
172
+ /**
173
+ * disallow reassignments of native objects or read-only globals ✅
174
+ * https://eslint.org/docs/rules/no-global-assign
175
+ */
176
+ "no-global-assign": "error",
177
+ /**
178
+ * disallow implicit type conversions 🔧
179
+ * https://eslint.org/docs/rules/no-implicit-coercion
180
+ */
181
+ "no-implicit-coercion": [
182
+ "error",
116
183
  {
117
184
  boolean: false,
118
185
  number: true,
119
186
  string: true,
120
187
  },
121
188
  ],
122
- /** disallow var and named functions in global scope
123
- * https://eslint.org/docs/rules/no-implicit-globals
124
- * disabled because it can't distinguish between a file with no imports and a browser script */
125
- 'no-implicit-globals': 'off',
126
- /** disallow use of eval()-like methods
127
- * https://eslint.org/docs/rules/no-implied-eval
128
- * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implied-eval.md */
129
- 'no-implied-eval': 'off',
130
- '@typescript-eslint/no-implied-eval': 'error',
131
- /** disallow this keywords outside of classes or class-like objects
132
- * https://eslint.org/docs/rules/no-invalid-this
133
- * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-invalid-this.md */
134
- 'no-invalid-this': 'off',
135
- '@typescript-eslint/no-invalid-this': 'off',
136
- /** disallow usage of __iterator__ property
137
- * https://eslint.org/docs/rules/no-iterator */
138
- 'no-iterator': 'error',
139
- /** disallow use of labels for anything other than loops and switches
140
- * https://eslint.org/docs/rules/no-labels */
141
- 'no-labels': 'error',
142
- /** disallow unnecessary nested blocks
143
- * https://eslint.org/docs/rules/no-lone-blocks */
144
- 'no-lone-blocks': 'error',
145
- /** disallow creation of functions within loops
146
- * https://eslint.org/docs/rules/no-loop-func
147
- * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loop-func.md */
148
- 'no-loop-func': 'off',
149
- '@typescript-eslint/no-loop-func': 'error',
150
- /** disallow magic numbers
151
- * https://eslint.org/docs/rules/no-magic-numbers
152
- * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-magic-numbers.md */
153
- 'no-magic-numbers': 'off',
154
- '@typescript-eslint/no-magic-numbers': ['error', { ignoreArrayIndexes: true }],
155
- /** disallow use of multiple spaces
156
- * https://eslint.org/docs/rules/no-multi-spaces */
157
- 'no-multi-spaces': 'error',
158
- /** disallow use of multiline strings
159
- * https://eslint.org/docs/rules/no-multi-str */
160
- 'no-multi-str': 'error',
161
- /** disallow use of new operator when not part of the assignment or comparison
162
- * https://eslint.org/docs/rules/no-new */
163
- 'no-new': 'error',
164
- /** disallow use of new operator for Function object
165
- * https://eslint.org/docs/rules/no-new-func */
166
- 'no-new-func': 'error',
167
- /** disallows creating new instances of String, Number, and Boolean
168
- * https://eslint.org/docs/rules/no-new-wrappers */
169
- 'no-new-wrappers': 'error',
170
- /** Disallow \8 and \9 escape sequences in string literals
171
- * https://eslint.org/docs/rules/no-nonoctal-decimal-escape */
172
- 'no-nonoctal-decimal-escape': 'error',
173
- /** disallow use of (old style) octal literals
174
- * https://eslint.org/docs/rules/no-octal */
175
- 'no-octal': 'error',
176
- /** disallow use of octal escape sequences in string literals, such as
177
- * https://eslint.org/docs/rules/no-octal-escape */
178
- 'no-octal-escape': 'error',
179
- /** disallow reassignment of function parameters, and
189
+ /**
190
+ * disallow var and named functions in global scope
191
+ * https://eslint.org/docs/rules/no-implicit-globals
192
+ * disabled because it can't distinguish between a file with no imports and a browser script
193
+ */
194
+ "no-implicit-globals": "off",
195
+ /**
196
+ * disallow use of eval()-like methods
197
+ * https://eslint.org/docs/rules/no-implied-eval
198
+ * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implied-eval.md
199
+ */
200
+ "no-implied-eval": "off",
201
+ "@typescript-eslint/no-implied-eval": "error",
202
+ /**
203
+ * disallow this keywords outside of classes or class-like objects
204
+ * https://eslint.org/docs/rules/no-invalid-this
205
+ * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-invalid-this.md
206
+ */
207
+ "no-invalid-this": "off",
208
+ "@typescript-eslint/no-invalid-this": "off",
209
+ /**
210
+ * disallow usage of __iterator__ property
211
+ * https://eslint.org/docs/rules/no-iterator
212
+ */
213
+ "no-iterator": "error",
214
+ /**
215
+ * disallow use of labels for anything other than loops and switches
216
+ * https://eslint.org/docs/rules/no-labels
217
+ */
218
+ "no-labels": "error",
219
+ /**
220
+ * disallow unnecessary nested blocks
221
+ * https://eslint.org/docs/rules/no-lone-blocks
222
+ */
223
+ "no-lone-blocks": "error",
224
+ /**
225
+ * disallow creation of functions within loops
226
+ * https://eslint.org/docs/rules/no-loop-func
227
+ * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loop-func.md
228
+ */
229
+ "no-loop-func": "off",
230
+ "@typescript-eslint/no-loop-func": "error",
231
+ /**
232
+ * disallow magic numbers
233
+ * https://eslint.org/docs/rules/no-magic-numbers
234
+ * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-magic-numbers.md
235
+ */
236
+ "no-magic-numbers": "off",
237
+ "@typescript-eslint/no-magic-numbers": [
238
+ "error",
239
+ {
240
+ ignore: [0,
241
+ 1,
242
+ 2],
243
+ ignoreArrayIndexes: true,
244
+ },
245
+ ],
246
+ /**
247
+ * disallow use of multiple spaces 🔧
248
+ * https://eslint.org/docs/rules/no-multi-spaces
249
+ */
250
+ "no-multi-spaces": "error",
251
+ /**
252
+ * disallow use of multiline strings
253
+ * https://eslint.org/docs/rules/no-multi-str
254
+ */
255
+ "no-multi-str": "error",
256
+ /**
257
+ * disallow use of new operator when not part of the assignment or comparison
258
+ * https://eslint.org/docs/rules/no-new
259
+ */
260
+ "no-new": "error",
261
+ /**
262
+ * disallow use of new operator for Function object
263
+ * https://eslint.org/docs/rules/no-new-func
264
+ */
265
+ "no-new-func": "error",
266
+ /**
267
+ * disallows creating new instances of String, Number, and Boolean
268
+ * https://eslint.org/docs/rules/no-new-wrappers
269
+ */
270
+ "no-new-wrappers": "error",
271
+ /**
272
+ * Disallow \8 and \9 escape sequences in string literals ✅
273
+ * https://eslint.org/docs/rules/no-nonoctal-decimal-escape
274
+ */
275
+ "no-nonoctal-decimal-escape": "error",
276
+ /**
277
+ * disallow use of (old style) octal literals ✅
278
+ * https://eslint.org/docs/rules/no-octal
279
+ */
280
+ "no-octal": "error",
281
+ /**
282
+ * disallow use of octal escape sequences in string literals, such as
283
+ * https://eslint.org/docs/rules/no-octal-escape
284
+ */
285
+ "no-octal-escape": "error",
286
+ /**
287
+ * disallow reassignment of function parameters, and
180
288
  * disallow parameter object manipulation except for specific exclusions
181
- * rule: https://eslint.org/docs/rules/no-param-reassign.html */
182
- 'no-param-reassign': [
183
- 'error',
289
+ * rule: https://eslint.org/docs/rules/no-param-reassign.html
290
+ */
291
+ "no-param-reassign": [
292
+ "error",
184
293
  {
185
294
  props: true,
186
295
  ignorePropertyModificationsFor: [
187
- 'acc',
188
- 'accumulator', // for reduce accumulators
296
+ "acc", "accumulator",
189
297
  ],
190
298
  },
191
299
  ],
192
- /** disallow usage of __proto__ property
193
- * https://eslint.org/docs/rules/no-proto */
194
- 'no-proto': 'error',
195
- /** disallow declaring the same variable more than once
196
- * https://eslint.org/docs/rules/no-redeclare
197
- * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-redeclare.md */
198
- 'no-redeclare': 'off',
199
- '@typescript-eslint/no-redeclare': 'error',
200
- /** disallow certain object properties
201
- * https://eslint.org/docs/rules/no-restricted-properties */
202
- 'no-restricted-properties': [
203
- 'error',
300
+ /**
301
+ * disallow usage of __proto__ property
302
+ * https://eslint.org/docs/rules/no-proto
303
+ */
304
+ "no-proto": "error",
305
+ /**
306
+ * disallow declaring the same variable more than once ✅
307
+ * https://eslint.org/docs/rules/no-redeclare
308
+ * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-redeclare.md
309
+ */
310
+ "no-redeclare": "off",
311
+ "@typescript-eslint/no-redeclare": "error",
312
+ /**
313
+ * disallow certain object properties
314
+ * https://eslint.org/docs/rules/no-restricted-properties
315
+ */
316
+ "no-restricted-properties": [
317
+ "error",
318
+ {
319
+ object: "arguments",
320
+ property: "callee",
321
+ message: "arguments.callee is deprecated",
322
+ },
323
+ {
324
+ object: "global",
325
+ property: "isFinite",
326
+ message: "Please use Number.isFinite instead",
327
+ },
328
+ {
329
+ object: "self",
330
+ property: "isFinite",
331
+ message: "Please use Number.isFinite instead",
332
+ },
333
+ {
334
+ object: "window",
335
+ property: "isFinite",
336
+ message: "Please use Number.isFinite instead",
337
+ },
338
+ {
339
+ object: "global",
340
+ property: "isNaN",
341
+ message: "Please use Number.isNaN instead",
342
+ },
343
+ {
344
+ object: "self",
345
+ property: "isNaN",
346
+ message: "Please use Number.isNaN instead",
347
+ },
348
+ {
349
+ object: "window",
350
+ property: "isNaN",
351
+ message: "Please use Number.isNaN instead",
352
+ },
353
+ {
354
+ property: "__defineGetter__",
355
+ message: "Please use Object.defineProperty instead.",
356
+ },
204
357
  {
205
- object: 'arguments',
206
- property: 'callee',
207
- message: 'arguments.callee is deprecated',
208
- }, {
209
- object: 'global',
210
- property: 'isFinite',
211
- message: 'Please use Number.isFinite instead',
212
- }, {
213
- object: 'self',
214
- property: 'isFinite',
215
- message: 'Please use Number.isFinite instead',
216
- }, {
217
- object: 'window',
218
- property: 'isFinite',
219
- message: 'Please use Number.isFinite instead',
220
- }, {
221
- object: 'global',
222
- property: 'isNaN',
223
- message: 'Please use Number.isNaN instead',
224
- }, {
225
- object: 'self',
226
- property: 'isNaN',
227
- message: 'Please use Number.isNaN instead',
228
- }, {
229
- object: 'window',
230
- property: 'isNaN',
231
- message: 'Please use Number.isNaN instead',
232
- }, {
233
- property: '__defineGetter__',
234
- message: 'Please use Object.defineProperty instead.',
235
- }, {
236
- property: '__defineSetter__',
237
- message: 'Please use Object.defineProperty instead.',
358
+ property: "__defineSetter__",
359
+ message: "Please use Object.defineProperty instead.",
238
360
  },
239
361
  ],
240
- /** disallow use of assignment in return statement
241
- * https://eslint.org/docs/rules/no-return-assign */
242
- 'no-return-assign': 'error',
243
- /** disallow redundant `return await`
244
- * https://eslint.org/docs/rules/no-return-await
245
- * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/return-await.md */
246
- 'no-return-await': 'off',
247
- '@typescript-eslint/return-await': 'error',
248
- /** disallow use of `javascript:` urls.
249
- * https://eslint.org/docs/rules/no-script-url */
250
- 'no-script-url': 'error',
251
- /** disallow self assignment
252
- * https://eslint.org/docs/rules/no-self-assign */
253
- 'no-self-assign': 'error',
254
- /** disallow comparisons where both sides are exactly the same
255
- * https://eslint.org/docs/rules/no-self-compare */
256
- 'no-self-compare': 'error',
257
- /** disallow use of comma operator
258
- * https://eslint.org/docs/rules/no-sequences */
259
- 'no-sequences': 'error',
260
- /** restrict what can be thrown as an exception
261
- * https://eslint.org/docs/rules/no-throw-literal
262
- * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-throw-literal.md */
263
- 'no-throw-literal': 'off',
264
- '@typescript-eslint/no-throw-literal': 'error',
265
- /** disallow unmodified conditions of loops
266
- * https://eslint.org/docs/rules/no-unmodified-loop-condition */
267
- 'no-unmodified-loop-condition': 'off',
268
- /** disallow usage of expressions in statement position
269
- * https://eslint.org/docs/rules/no-unused-expressions
270
- * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-expressions.md */
271
- 'no-unused-expressions': 'off',
272
- '@typescript-eslint/no-unused-expressions': ['error', { allowTaggedTemplates: false }],
273
- /** disallow unused labels
274
- * https://eslint.org/docs/rules/no-unused-labels */
275
- 'no-unused-labels': 'error',
276
- /** disallow unnecessary .call() and .apply()
277
- * https://eslint.org/docs/rules/no-useless-call */
278
- 'no-useless-call': 'off',
279
- /** Disallow unnecessary catch clauses
280
- * https://eslint.org/docs/rules/no-useless-catch */
281
- 'no-useless-catch': 'error',
282
- /** disallow useless string concatenation
283
- * https://eslint.org/docs/rules/no-useless-concat */
284
- 'no-useless-concat': 'error',
285
- /** disallow unnecessary string escaping
286
- * https://eslint.org/docs/rules/no-useless-escape */
287
- 'no-useless-escape': 'error',
288
- /** disallow redundant return; keywords
289
- * https://eslint.org/docs/rules/no-useless-return */
290
- 'no-useless-return': 'error',
291
- /** disallow use of void operator
292
- * https://eslint.org/docs/rules/no-void */
293
- 'no-void': 'error',
294
- /** disallow usage of configurable warning terms in comments: e.g. todo
295
- * https://eslint.org/docs/rules/no-warning-comments */
296
- 'no-warning-comments': 'off',
297
- /** disallow use of the with statement
298
- * https://eslint.org/docs/rules/no-with */
299
- 'no-with': 'error',
300
- /** require using Error objects as Promise rejection reasons
301
- * https://eslint.org/docs/rules/prefer-promise-reject-errors */
302
- 'prefer-promise-reject-errors': ['error', { allowEmptyReject: true }],
303
- /** Suggest using named capture group in regular expression
304
- * https://eslint.org/docs/rules/prefer-named-capture-group */
305
- 'prefer-named-capture-group': 'off',
306
- /** disallow use of the `RegExp` constructor in favor of regular expression literals
307
- * https://eslint.org/docs/rules/prefer-regex-literals */
308
- 'prefer-regex-literals': 'error',
309
- /** require use of the second argument for parseInt()
310
- * https://eslint.org/docs/rules/radix */
311
- radix: 'error',
312
- /** require `await` in `async function` (note: this is a horrible rule that should never be used)
313
- * https://eslint.org/docs/rules/require-await
314
- * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.md */
315
- 'require-await': 'off',
316
- '@typescript-eslint/require-await': 'off',
317
- /** Enforce the use of u flag on RegExp
318
- * https://eslint.org/docs/rules/require-unicode-regexp */
319
- 'require-unicode-regexp': 'off',
320
- /** requires to declare all vars on top of their containing scope
321
- * https://eslint.org/docs/rules/vars-on-top
322
- * Off because var is forbidden */
323
- 'vars-on-top': 'off',
324
- /** require immediate function invocation to be wrapped in parentheses
325
- * https://eslint.org/docs/rules/wrap-iife.html */
326
- 'wrap-iife': ['error', 'outside', { functionPrototypeMethods: false }],
327
- /** require or disallow Yoda conditions
328
- * https://eslint.org/docs/rules/yoda */
329
- yoda: 'error'
362
+ /**
363
+ * disallow use of assignment in return statement
364
+ * https://eslint.org/docs/rules/no-return-assign
365
+ */
366
+ "no-return-assign": "error",
367
+ /**
368
+ * disallow redundant `return await`
369
+ * https://eslint.org/docs/rules/no-return-await
370
+ * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/return-await.md
371
+ */
372
+ "no-return-await": "off",
373
+ "@typescript-eslint/return-await": "error",
374
+ /**
375
+ * disallow use of `javascript:` urls.
376
+ * https://eslint.org/docs/rules/no-script-url
377
+ */
378
+ "no-script-url": "error",
379
+ /**
380
+ * disallow self assignment ✅
381
+ * https://eslint.org/docs/rules/no-self-assign
382
+ */
383
+ "no-self-assign": "error",
384
+ /**
385
+ * disallow comparisons where both sides are exactly the same
386
+ * https://eslint.org/docs/rules/no-self-compare
387
+ */
388
+ "no-self-compare": "error",
389
+ /**
390
+ * disallow use of comma operator
391
+ * https://eslint.org/docs/rules/no-sequences
392
+ */
393
+ "no-sequences": "error",
394
+ /**
395
+ * restrict what can be thrown as an exception
396
+ * https://eslint.org/docs/rules/no-throw-literal
397
+ * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-throw-literal.md
398
+ */
399
+ "no-throw-literal": "off",
400
+ "@typescript-eslint/no-throw-literal": "error",
401
+ /**
402
+ * disallow unmodified conditions of loops
403
+ * https://eslint.org/docs/rules/no-unmodified-loop-condition
404
+ */
405
+ "no-unmodified-loop-condition": "off",
406
+ /**
407
+ * disallow usage of expressions in statement position
408
+ * https://eslint.org/docs/rules/no-unused-expressions
409
+ * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-expressions.md
410
+ */
411
+ "no-unused-expressions": "off",
412
+ "@typescript-eslint/no-unused-expressions": ["error", { allowTaggedTemplates: false }],
413
+ /**
414
+ * disallow unused labels ✅ 🔧
415
+ * https://eslint.org/docs/rules/no-unused-labels
416
+ */
417
+ "no-unused-labels": "error",
418
+ /**
419
+ * disallow unnecessary .call() and .apply()
420
+ * https://eslint.org/docs/rules/no-useless-call
421
+ */
422
+ "no-useless-call": "off",
423
+ /**
424
+ * Disallow unnecessary catch clauses
425
+ * https://eslint.org/docs/rules/no-useless-catch
426
+ */
427
+ "no-useless-catch": "error",
428
+ /**
429
+ * disallow useless string concatenation
430
+ * https://eslint.org/docs/rules/no-useless-concat
431
+ */
432
+ "no-useless-concat": "error",
433
+ /**
434
+ * disallow unnecessary string escaping
435
+ * https://eslint.org/docs/rules/no-useless-escape
436
+ */
437
+ "no-useless-escape": "error",
438
+ /**
439
+ * disallow redundant return; keywords 🔧
440
+ * https://eslint.org/docs/rules/no-useless-return
441
+ */
442
+ "no-useless-return": "error",
443
+ /**
444
+ * disallow use of void operator
445
+ * https://eslint.org/docs/rules/no-void
446
+ */
447
+ "no-void": "error",
448
+ /**
449
+ * disallow usage of configurable warning terms in comments: e.g. todo
450
+ * https://eslint.org/docs/rules/no-warning-comments
451
+ */
452
+ "no-warning-comments": "off",
453
+ /**
454
+ * disallow use of the with statement ✅
455
+ * https://eslint.org/docs/rules/no-with
456
+ */
457
+ "no-with": "error",
458
+ /**
459
+ * require using Error objects as Promise rejection reasons
460
+ * https://eslint.org/docs/rules/prefer-promise-reject-errors
461
+ */
462
+ "prefer-promise-reject-errors": ["error", { allowEmptyReject: true }],
463
+ /**
464
+ * Suggest using named capture group in regular expression
465
+ * https://eslint.org/docs/rules/prefer-named-capture-group
466
+ */
467
+ "prefer-named-capture-group": "off",
468
+ /**
469
+ * disallow use of the `RegExp` constructor in favor of regular expression literals
470
+ * https://eslint.org/docs/rules/prefer-regex-literals
471
+ */
472
+ "prefer-regex-literals": "error",
473
+ /**
474
+ * require use of the second argument for parseInt()
475
+ * https://eslint.org/docs/rules/radix
476
+ */
477
+ radix: "error",
478
+ /**
479
+ * require `await` in `async function` (note: this is a horrible rule that should never be used)
480
+ * https://eslint.org/docs/rules/require-await
481
+ * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.md
482
+ */
483
+ "require-await": "off",
484
+ "@typescript-eslint/require-await": "off",
485
+ /**
486
+ * Enforce the use of u flag on RegExp
487
+ * https://eslint.org/docs/rules/require-unicode-regexp
488
+ */
489
+ "require-unicode-regexp": "off",
490
+ /**
491
+ * requires to declare all vars on top of their containing scope
492
+ * https://eslint.org/docs/rules/vars-on-top
493
+ * Off because var is forbidden
494
+ */
495
+ "vars-on-top": "off",
496
+ /**
497
+ * require immediate function invocation to be wrapped in parentheses
498
+ * https://eslint.org/docs/rules/wrap-iife.html
499
+ */
500
+ "wrap-iife": ["error",
501
+ "outside",
502
+ { functionPrototypeMethods: false }],
503
+ /**
504
+ * require or disallow Yoda conditions 🔧
505
+ * https://eslint.org/docs/rules/yoda
506
+ */
507
+ yoda: "error",
330
508
  };