@spscommerce/eslint-config-typescript 0.0.4 → 0.0.8

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.
@@ -237,9 +237,12 @@ exports.bestPractices = {
237
237
  "@typescript-eslint/no-magic-numbers": [
238
238
  "error",
239
239
  {
240
- ignore: [0,
240
+ ignore: [
241
+ -1,
242
+ 0,
241
243
  1,
242
- 2],
244
+ 2,
245
+ ],
243
246
  ignoreArrayIndexes: true,
244
247
  },
245
248
  ],
@@ -443,8 +446,9 @@ exports.bestPractices = {
443
446
  /**
444
447
  * disallow use of void operator
445
448
  * https://eslint.org/docs/rules/no-void
449
+ * Typing for this rule config seems to be incorrect
446
450
  */
447
- "no-void": "error",
451
+ "no-void": ["error", { allowAsStatement: true }],
448
452
  /**
449
453
  * disallow usage of configurable warning terms in comments: e.g. todo
450
454
  * https://eslint.org/docs/rules/no-warning-comments
@@ -93,8 +93,9 @@ exports.possibleErrors = {
93
93
  /**
94
94
  * disallow double-negation boolean casts in a boolean context ✅ 🔧
95
95
  * https://eslint.org/docs/rules/no-extra-boolean-cast
96
+ * Disabled because it conflicts with @typescript-eslint/strict-boolean-expressions
96
97
  */
97
- "no-extra-boolean-cast": "error",
98
+ "no-extra-boolean-cast": "off",
98
99
  /**
99
100
  * disallow unnecessary parentheses 🔧
100
101
  * https://eslint.org/docs/rules/no-extra-parens
@@ -106,8 +106,9 @@ exports.stylisticIssues = {
106
106
  /**
107
107
  * enforce consistent line breaks inside function parentheses 🔧
108
108
  * https://eslint.org/docs/rules/function-paren-newline
109
+ * Disabled because it results in conflicts with Prettier
109
110
  */
110
- "function-paren-newline": ["error", "consistent"],
111
+ "function-paren-newline": "off",
111
112
  /**
112
113
  * Blacklist certain identifiers to prevent them being used
113
114
  * https://eslint.org/docs/rules/id-blacklist
@@ -132,8 +133,9 @@ exports.stylisticIssues = {
132
133
  /**
133
134
  * Enforce the location of arrow function bodies with implicit returns 🔧
134
135
  * https://eslint.org/docs/rules/implicit-arrow-linebreak
136
+ * Disabled because it results in conflicts with Prettier
135
137
  */
136
- "implicit-arrow-linebreak": "error",
138
+ "implicit-arrow-linebreak": "off",
137
139
  /**
138
140
  * this option sets a specific tab width for your code 🔧
139
141
  * https://eslint.org/docs/rules/indent
@@ -417,10 +419,9 @@ exports.stylisticIssues = {
417
419
  /**
418
420
  * Requires operator at the beginning of the line in multiline statements 🔧
419
421
  * https://eslint.org/docs/rules/operator-linebreak
422
+ * Disabled because it results in conflicts with Prettier
420
423
  */
421
- "operator-linebreak": ["error",
422
- "before",
423
- { overrides: { "=": "none" } }],
424
+ "operator-linebreak": "off",
424
425
  /**
425
426
  * disallow padding within blocks 🔧
426
427
  * https://eslint.org/docs/rules/padded-blocks
@@ -111,10 +111,7 @@ exports.typescript = {
111
111
  * Requires expressions of type void to appear in statement position 🔧 💭
112
112
  * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md
113
113
  */
114
- "@typescript-eslint/no-confusing-void-expression": [
115
- "error",
116
- { "ignoreArrowShorthand": true }
117
- ],
114
+ "@typescript-eslint/no-confusing-void-expression": ["error", { ignoreArrowShorthand: true }],
118
115
  /**
119
116
  * Disallow the delete operator with computed key expressions 🔧
120
117
  * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-dynamic-delete.md
@@ -284,8 +281,10 @@ exports.typescript = {
284
281
  /**
285
282
  * Prefers a non-null assertion over explicit type cast when possible 🔧 💭
286
283
  * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md
284
+ * Disabled because it enforces use of postfix ! operator, which is banned by
285
+ * @typescript-eslint/no-non-null-assertion (a recommended rule)
287
286
  */
288
- "@typescript-eslint/non-nullable-type-assertion-style": "error",
287
+ "@typescript-eslint/non-nullable-type-assertion-style": "off",
289
288
  /**
290
289
  * Prefer usage of as const over literal type ✅ 🔧
291
290
  * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-as-const.md
@@ -328,18 +327,18 @@ exports.typescript = {
328
327
  * Enforce the usage of the nullish coalescing operator instead of logical chaining 💭
329
328
  * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md
330
329
  */
331
- "@typescript-eslint/prefer-nullish-coalescing": "off",
330
+ "@typescript-eslint/prefer-nullish-coalescing": "error",
332
331
  /**
333
332
  * Prefer using concise optional chain expressions instead of chained logical ands
334
333
  * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-optional-chain.md
335
334
  */
336
- "@typescript-eslint/prefer-optional-chain": "off",
335
+ "@typescript-eslint/prefer-optional-chain": "error",
337
336
  /**
338
337
  * Requires that private members are marked as `readonly` if
339
338
  * they're never modified outside of the constructor 🔧 💭
340
339
  * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-readonly.md
341
340
  */
342
- "@typescript-eslint/prefer-readonly": "off",
341
+ "@typescript-eslint/prefer-readonly": "error",
343
342
  /**
344
343
  * Requires that function parameters are typed as `readonly`
345
344
  * to prevent accidental mutation of inputs 💭
@@ -350,7 +349,7 @@ exports.typescript = {
350
349
  * Prefer using type parameter when calling `Array#reduce` instead of casting 🔧 💭
351
350
  * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md
352
351
  */
353
- "@typescript-eslint/prefer-reduce-type-parameter": "off",
352
+ "@typescript-eslint/prefer-reduce-type-parameter": "error",
354
353
  /**
355
354
  * Enforce that `RegExp#exec` is used instead of `String#match`
356
355
  * if no global flag is provided ✅ 🔧 💭
@@ -361,18 +360,18 @@ exports.typescript = {
361
360
  * Enforce that `this` is used when only `this` type is returned 🔧 💭
362
361
  * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-return-this-type.md
363
362
  */
364
- "@typescript-eslint/prefer-return-this-type": "off",
363
+ "@typescript-eslint/prefer-return-this-type": "error",
365
364
  /**
366
365
  * Enforce the use of `String#startsWith` and `String#endsWith` instead
367
366
  * of other equivalent methods of checking substrings 🔧 💭
368
367
  * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md
369
368
  */
370
- "@typescript-eslint/prefer-string-starts-ends-with": "off",
369
+ "@typescript-eslint/prefer-string-starts-ends-with": "error",
371
370
  /**
372
371
  * Recommends using `@ts-expect-error` over `@ts-ignore` 🔧
373
372
  * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-ts-expect-error.md
374
373
  */
375
- "@typescript-eslint/prefer-ts-expect-error": "off",
374
+ "@typescript-eslint/prefer-ts-expect-error": "error",
376
375
  /**
377
376
  * Requires any function or method that returns a Promise to be marked async 🔧 💭
378
377
  * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/promise-function-async.md
@@ -382,7 +381,7 @@ exports.typescript = {
382
381
  * Requires `Array#sort` calls to always provide a `compareFunction` 💭
383
382
  * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-array-sort-compare.md
384
383
  */
385
- "@typescript-eslint/require-array-sort-compare": "off",
384
+ "@typescript-eslint/require-array-sort-compare": "error",
386
385
  /**
387
386
  * When adding two variables, operands must both be of type number or of type string ✅ 💭
388
387
  * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/restrict-plus-operands.md
@@ -397,17 +396,17 @@ exports.typescript = {
397
396
  * Enforces that members of a type union/intersection are sorted alphabetically 🔧
398
397
  * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.md
399
398
  */
400
- "@typescript-eslint/sort-type-union-intersection-members": "off",
399
+ "@typescript-eslint/sort-type-union-intersection-members": "error",
401
400
  /**
402
401
  * Restricts the types allowed in boolean expressions 🔧 💭
403
402
  * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md
404
403
  */
405
- "@typescript-eslint/strict-boolean-expressions": "off",
404
+ "@typescript-eslint/strict-boolean-expressions": "error",
406
405
  /**
407
406
  * Exhaustiveness checking in switch with union type 💭
408
407
  * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md
409
408
  */
410
- "@typescript-eslint/switch-exhaustiveness-check": "off",
409
+ "@typescript-eslint/switch-exhaustiveness-check": "error",
411
410
  /**
412
411
  * Sets preference level for triple slash directives versus ES6-style import declarations ✅
413
412
  * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/triple-slash-reference.md
@@ -417,7 +416,7 @@ exports.typescript = {
417
416
  * Require consistent spacing around type annotations 🔧
418
417
  * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/type-annotation-spacing.md
419
418
  */
420
- "@typescript-eslint/type-annotation-spacing": "off",
419
+ "@typescript-eslint/type-annotation-spacing": "error",
421
420
  /**
422
421
  * Requires type annotations to exist
423
422
  * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/typedef.md
@@ -427,11 +426,11 @@ exports.typescript = {
427
426
  * Enforces unbound methods are called with their expected scope ✅ 💭
428
427
  * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/unbound-method.md
429
428
  */
430
- "@typescript-eslint/unbound-method": "off",
429
+ "@typescript-eslint/unbound-method": ["error", { ignoreStatic: true }],
431
430
  /**
432
431
  * Warns for any two overloads that could be unified into
433
432
  * one by using a union or an optional/rest parameter
434
433
  * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/unified-signatures.md
435
434
  */
436
- "@typescript-eslint/unified-signatures": "off",
435
+ "@typescript-eslint/unified-signatures": "warn",
437
436
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spscommerce/eslint-config-typescript",
3
- "version": "0.0.4",
3
+ "version": "0.0.8",
4
4
  "description": "SPS official linter configuration for TypeScript.",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {