@typescript-eslint/eslint-plugin 8.0.0-alpha.3 → 8.0.0-alpha.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/dist/configs/all.js +2 -5
  2. package/dist/configs/all.js.map +1 -1
  3. package/dist/configs/disable-type-checked.js +1 -2
  4. package/dist/configs/disable-type-checked.js.map +1 -1
  5. package/dist/configs/recommended-type-checked-only.js +6 -0
  6. package/dist/configs/recommended-type-checked-only.js.map +1 -1
  7. package/dist/configs/recommended-type-checked.js +11 -1
  8. package/dist/configs/recommended-type-checked.js.map +1 -1
  9. package/dist/configs/recommended.js +5 -1
  10. package/dist/configs/recommended.js.map +1 -1
  11. package/dist/configs/strict-type-checked-only.js +2 -2
  12. package/dist/configs/strict-type-checked-only.js.map +1 -1
  13. package/dist/configs/strict-type-checked.js +7 -4
  14. package/dist/configs/strict-type-checked.js.map +1 -1
  15. package/dist/configs/strict.js +5 -2
  16. package/dist/configs/strict.js.map +1 -1
  17. package/dist/configs/stylistic-type-checked-only.js +3 -0
  18. package/dist/configs/stylistic-type-checked-only.js.map +1 -1
  19. package/dist/configs/stylistic-type-checked.js +3 -2
  20. package/dist/configs/stylistic-type-checked.js.map +1 -1
  21. package/dist/configs/stylistic.js +0 -2
  22. package/dist/configs/stylistic.js.map +1 -1
  23. package/dist/rules/ban-types.js +4 -25
  24. package/dist/rules/ban-types.js.map +1 -1
  25. package/dist/rules/consistent-type-assertions.js +3 -5
  26. package/dist/rules/consistent-type-assertions.js.map +1 -1
  27. package/dist/rules/dot-notation.js +8 -1
  28. package/dist/rules/dot-notation.js.map +1 -1
  29. package/dist/rules/explicit-member-accessibility.js +98 -36
  30. package/dist/rules/explicit-member-accessibility.js.map +1 -1
  31. package/dist/rules/index.js +4 -4
  32. package/dist/rules/index.js.map +1 -1
  33. package/dist/rules/init-declarations.js +57 -1
  34. package/dist/rules/init-declarations.js.map +1 -1
  35. package/dist/rules/member-ordering.js +1 -2
  36. package/dist/rules/member-ordering.js.map +1 -1
  37. package/dist/rules/naming-convention-utils/parse-options.js +1 -3
  38. package/dist/rules/naming-convention-utils/parse-options.js.map +1 -1
  39. package/dist/rules/no-array-delete.js +1 -1
  40. package/dist/rules/no-array-delete.js.map +1 -1
  41. package/dist/rules/no-base-to-string.js +1 -1
  42. package/dist/rules/no-base-to-string.js.map +1 -1
  43. package/dist/rules/no-duplicate-type-constituents.js +1 -1
  44. package/dist/rules/no-duplicate-type-constituents.js.map +1 -1
  45. package/dist/rules/no-empty-interface.js +2 -1
  46. package/dist/rules/no-empty-interface.js.map +1 -1
  47. package/dist/rules/no-empty-object-type.js +141 -0
  48. package/dist/rules/no-empty-object-type.js.map +1 -0
  49. package/dist/rules/no-floating-promises.js +62 -39
  50. package/dist/rules/no-floating-promises.js.map +1 -1
  51. package/dist/rules/no-implied-eval.js.map +1 -1
  52. package/dist/rules/no-require-imports.js +13 -3
  53. package/dist/rules/no-require-imports.js.map +1 -1
  54. package/dist/rules/no-restricted-imports.js +3 -6
  55. package/dist/rules/no-restricted-imports.js.map +1 -1
  56. package/dist/rules/{no-useless-template-literals.js → no-unnecessary-template-expression.js} +6 -6
  57. package/dist/rules/no-unnecessary-template-expression.js.map +1 -0
  58. package/dist/rules/no-unnecessary-type-assertion.js +15 -13
  59. package/dist/rules/no-unnecessary-type-assertion.js.map +1 -1
  60. package/dist/rules/no-unsafe-argument.js +4 -2
  61. package/dist/rules/no-unsafe-argument.js.map +1 -1
  62. package/dist/rules/no-unsafe-assignment.js +24 -9
  63. package/dist/rules/no-unsafe-assignment.js.map +1 -1
  64. package/dist/rules/no-unsafe-return.js +1 -1
  65. package/dist/rules/no-unsafe-return.js.map +1 -1
  66. package/dist/rules/no-unsafe-unary-minus.js +1 -0
  67. package/dist/rules/no-unsafe-unary-minus.js.map +1 -1
  68. package/dist/rules/no-unused-expressions.js +1 -0
  69. package/dist/rules/no-unused-expressions.js.map +1 -1
  70. package/dist/rules/no-unused-vars.js +13 -3
  71. package/dist/rules/no-unused-vars.js.map +1 -1
  72. package/dist/rules/no-var-requires.js +2 -1
  73. package/dist/rules/no-var-requires.js.map +1 -1
  74. package/dist/rules/only-throw-error.js +1 -1
  75. package/dist/rules/only-throw-error.js.map +1 -1
  76. package/dist/rules/prefer-find.js +1 -0
  77. package/dist/rules/prefer-find.js.map +1 -1
  78. package/dist/rules/prefer-includes.js +1 -1
  79. package/dist/rules/prefer-includes.js.map +1 -1
  80. package/dist/rules/prefer-literal-enum-member.js +43 -2
  81. package/dist/rules/prefer-literal-enum-member.js.map +1 -1
  82. package/dist/rules/prefer-namespace-keyword.js +1 -1
  83. package/dist/rules/prefer-namespace-keyword.js.map +1 -1
  84. package/dist/rules/prefer-promise-reject-errors.js +1 -1
  85. package/dist/rules/prefer-promise-reject-errors.js.map +1 -1
  86. package/dist/rules/prefer-readonly.js +8 -5
  87. package/dist/rules/prefer-readonly.js.map +1 -1
  88. package/dist/rules/prefer-regexp-exec.js +15 -6
  89. package/dist/rules/prefer-regexp-exec.js.map +1 -1
  90. package/dist/rules/prefer-ts-expect-error.js +2 -1
  91. package/dist/rules/prefer-ts-expect-error.js.map +1 -1
  92. package/dist/rules/require-await.js +1 -1
  93. package/dist/rules/require-await.js.map +1 -1
  94. package/dist/rules/return-await.js +86 -55
  95. package/dist/rules/return-await.js.map +1 -1
  96. package/dist/rules/sort-type-constituents.js +23 -1
  97. package/dist/rules/sort-type-constituents.js.map +1 -1
  98. package/dist/rules/strict-boolean-expressions.js +1 -3
  99. package/dist/rules/strict-boolean-expressions.js.map +1 -1
  100. package/dist/rules/switch-exhaustiveness-check.js +7 -9
  101. package/dist/rules/switch-exhaustiveness-check.js.map +1 -1
  102. package/dist/rules/unified-signatures.js +3 -1
  103. package/dist/rules/unified-signatures.js.map +1 -1
  104. package/dist/util/collectUnusedVariables.js +22 -35
  105. package/dist/util/collectUnusedVariables.js.map +1 -1
  106. package/dist/util/createRule.js.map +1 -1
  107. package/dist/util/explicitReturnTypeUtils.js +5 -0
  108. package/dist/util/explicitReturnTypeUtils.js.map +1 -1
  109. package/dist/util/getFunctionHeadLoc.js.map +1 -1
  110. package/dist/util/getOperatorPrecedence.js +1 -1
  111. package/dist/util/getOperatorPrecedence.js.map +1 -1
  112. package/docs/rules/ban-types.mdx +5 -10
  113. package/docs/rules/consistent-type-imports.mdx +1 -1
  114. package/docs/rules/naming-convention.mdx +16 -0
  115. package/docs/rules/no-base-to-string.mdx +1 -1
  116. package/docs/rules/no-duplicate-imports.mdx +1 -1
  117. package/docs/rules/no-dynamic-delete.mdx +6 -2
  118. package/docs/rules/no-empty-interface.mdx +10 -0
  119. package/docs/rules/no-empty-object-type.mdx +145 -0
  120. package/docs/rules/no-floating-promises.mdx +103 -4
  121. package/docs/rules/no-import-type-side-effects.mdx +1 -1
  122. package/docs/rules/no-misused-promises.mdx +18 -20
  123. package/docs/rules/no-require-imports.mdx +28 -1
  124. package/docs/rules/no-unnecessary-boolean-literal-compare.mdx +12 -12
  125. package/docs/rules/no-unnecessary-template-expression.mdx +85 -0
  126. package/docs/rules/no-unused-expressions.mdx +41 -1
  127. package/docs/rules/no-unused-vars.mdx +5 -0
  128. package/docs/rules/no-useless-template-literals.mdx +3 -59
  129. package/docs/rules/no-var-requires.mdx +6 -0
  130. package/docs/rules/only-throw-error.mdx +7 -0
  131. package/docs/rules/prefer-readonly-parameter-types.mdx +10 -4
  132. package/docs/rules/prefer-ts-expect-error.mdx +10 -0
  133. package/docs/rules/require-await.mdx +2 -2
  134. package/docs/rules/restrict-template-expressions.mdx +1 -1
  135. package/docs/rules/return-await.mdx +39 -16
  136. package/docs/rules/sort-type-constituents.mdx +29 -9
  137. package/docs/rules/sort-type-union-intersection-members.mdx +12 -0
  138. package/docs/rules/unbound-method.mdx +3 -2
  139. package/package.json +14 -17
  140. package/rules.d.ts +6 -2
  141. package/dist/rules/no-throw-literal.js +0 -97
  142. package/dist/rules/no-throw-literal.js.map +0 -1
  143. package/dist/rules/no-useless-template-literals.js.map +0 -1
  144. package/docs/rules/no-throw-literal.mdx +0 -25
@@ -178,6 +178,7 @@ function getOperatorPrecedenceForNode(node) {
178
178
  case utils_1.AST_NODE_TYPES.RestElement:
179
179
  return OperatorPrecedence.Spread;
180
180
  case utils_1.AST_NODE_TYPES.YieldExpression:
181
+ case utils_1.AST_NODE_TYPES.ArrowFunctionExpression:
181
182
  return OperatorPrecedence.Yield;
182
183
  case utils_1.AST_NODE_TYPES.ConditionalExpression:
183
184
  return OperatorPrecedence.Conditional;
@@ -240,7 +241,6 @@ function getOperatorPrecedenceForNode(node) {
240
241
  case utils_1.AST_NODE_TYPES.ArrayExpression:
241
242
  case utils_1.AST_NODE_TYPES.ObjectExpression:
242
243
  case utils_1.AST_NODE_TYPES.FunctionExpression:
243
- case utils_1.AST_NODE_TYPES.ArrowFunctionExpression:
244
244
  case utils_1.AST_NODE_TYPES.ClassExpression:
245
245
  case utils_1.AST_NODE_TYPES.TemplateLiteral:
246
246
  case utils_1.AST_NODE_TYPES.JSXElement:
@@ -1 +1 @@
1
- {"version":3,"file":"getOperatorPrecedence.js","sourceRoot":"","sources":["../../src/util/getOperatorPrecedence.ts"],"names":[],"mappings":";;;AAEA,oDAA0D;AAC1D,2CAAwC;AAIxC,IAAY,kBA8LX;AA9LD,WAAY,kBAAkB;IAC5B,cAAc;IACd,2BAA2B;IAC3B,0CAA0C;IAC1C,6DAAK,CAAA;IAEL,iFAAiF;IACjF,iBAAiB;IACjB,iCAAiC;IACjC,+DAAM,CAAA;IAEN,wBAAwB;IACxB,4BAA4B;IAC5B,sBAAsB;IACtB,oBAAoB;IACpB,yBAAyB;IACzB,sDAAsD;IACtD,qEAAqE;IACrE,EAAE;IACF,6FAA6F;IAC7F,mCAAmC;IAEnC,wCAAwC;IACxC,mBAAmB;IACnB,cAAc;IACd,mCAAmC;IACnC,uCAAuC;IACvC,6DAAK,CAAA;IAEL,wEAAwE;IACxE,uFAAuF;IACvF,6BAA6B;IAC7B,uEAAu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AC9B,KAAK,GAAG,CAAC;QACT,KAAK,uBAAU,CAAC,UAAU,CAAC;QAC3B,KAAK,GAAG,CAAC;QACT,KAAK,uBAAU,CAAC,YAAY,CAAC;QAC7B,KAAK,GAAG;YACN,OAAO,kBAAkB,CAAC,cAAc,CAAC;QAE3C,KAAK,uBAAU,CAAC,qBAAqB,CAAC;QACtC,KAAK,IAAI;YACP,OAAO,kBAAkB,CAAC,cAAc,CAAC;IAC7C,CAAC;IAED,qFAAqF;IACrF,mBAAmB;IACnB,OAAO,CAAC,CAAC,CAAC;AACZ,CAAC;AApFD,kEAoFC"}
1
+ {"version":3,"file":"getOperatorPrecedence.js","sourceRoot":"","sources":["../../src/util/getOperatorPrecedence.ts"],"names":[],"mappings":";;;AAEA,oDAA0D;AAC1D,2CAAwC;AAIxC,IAAY,kBA8LX;AA9LD,WAAY,kBAAkB;IAC5B,cAAc;IACd,2BAA2B;IAC3B,0CAA0C;IAC1C,6DAAK,CAAA;IAEL,iFAAiF;IACjF,iBAAiB;IACjB,iCAAiC;IACjC,+DAAM,CAAA;IAEN,wBAAwB;IACxB,4BAA4B;IAC5B,sBAAsB;IACtB,oBAAoB;IACpB,yBAAyB;IACzB,sDAAsD;IACtD,qEAAqE;IACrE,EAAE;IACF,6FAA6F;IAC7F,mCAAmC;IAEnC,wCAAwC;IACxC,mBAAmB;IACnB,cAAc;IACd,mCAAmC;IACnC,uCAAuC;IACvC,6DAAK,CAAA;IAEL,wEAAwE;IACxE,uFAAuF;IACvF,6BAA6B;IAC7B,uEAAuE;IACvE,uEAAU,CAAA;IAEV,4FAA4F;IAC5F,6BAA6B;IAC7B,8CAA8C;IAC9C,yBAAyB;IACzB,6BAA6B;IAC7B,+EAA+E;IAC/E,0BAA0B;IAC1B,0BAA0B;IAC1B,yBAAyB;IACzB,yEAAW,CAAA;IAEX,sBAAsB;IACtB,sDAAsD;IACtD,0BAA0B;IAC1B,yBAAyB;IACzB,0BAA0B;IAC1B,mEAAsB,CAAA;IAEtB,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AAC;IAED,qFAAqF;IACrF,mBAAmB;IACnB,OAAO,CAAC,CAAC,CAAC;AACZ,CAAC;AApFD,kEAoFC"}
@@ -36,9 +36,6 @@ const func: Function = () => 1;
36
36
  // use safer object types
37
37
  const lowerObj: Object = {};
38
38
  const capitalObj: Object = { a: 'string' };
39
-
40
- const curly1: {} = 1;
41
- const curly2: {} = { a: 'string' };
42
39
  ```
43
40
 
44
41
  </TabItem>
@@ -58,9 +55,6 @@ const func: () => number = () => 1;
58
55
  // use safer object types
59
56
  const lowerObj: object = {};
60
57
  const capitalObj: { a: string } = { a: 'string' };
61
-
62
- const curly1: number = 1;
63
- const curly2: Record<'a', string> = { a: 'string' };
64
58
  ```
65
59
 
66
60
  </TabItem>
@@ -70,13 +64,10 @@ const curly2: Record<'a', string> = { a: 'string' };
70
64
 
71
65
  The default options provide a set of "best practices", intended to provide safety and standardization in your codebase:
72
66
 
73
- - Don't use the upper-case primitive types, you should use the lower-case types for consistency.
67
+ - Don't use the upper-case primitive types or `Object`, you should use the lower-case types for consistency.
74
68
  - Avoid the `Function` type, as it provides little safety for the following reasons:
75
69
  - It provides no type safety when calling the value, which means it's easy to provide the wrong arguments.
76
70
  - It accepts class declarations, which will fail when called, as they are called without the `new` keyword.
77
- - Avoid the `Object` and `{}` types, as they mean "any non-nullish value".
78
- - This is a point of confusion for many developers, who think it means "any object type".
79
- - See [this comment for more information](https://github.com/typescript-eslint/typescript-eslint/issues/2063#issuecomment-675156492).
80
71
 
81
72
  <details>
82
73
  <summary>Default Options</summary>
@@ -136,3 +127,7 @@ Example configuration:
136
127
 
137
128
  If your project is a rare one that intentionally deals with the class equivalents of primitives, it might not be worthwhile to enable the default `ban-types` options.
138
129
  You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule.
130
+
131
+ ## Related To
132
+
133
+ - [`no-empty-object-type`](./no-empty-object-type.mdx)
@@ -132,5 +132,5 @@ We recommend picking a single option for this rule that works best for your proj
132
132
  ## Related To
133
133
 
134
134
  - [`no-import-type-side-effects`](./no-import-type-side-effects.mdx)
135
- - [`import/consistent-type-specifier-style`](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/consistent-type-specifier-style.mdx)
135
+ - [`import/consistent-type-specifier-style`](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/consistent-type-specifier-style.md)
136
136
  - [`import/no-duplicates` with `{"prefer-inline": true}`](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-duplicates.md#inline-type-imports)
@@ -583,6 +583,22 @@ This allows you to emulate the old `interface-name-prefix` rule.
583
583
  }
584
584
  ```
585
585
 
586
+ ### Enforce that function names are either in camelCase or PascalCase
587
+
588
+ Function names are typically camelCase, but UI library components (especially JSX, such as React and Solid) use PascalCase to distinguish them from intrinsic elements. If you are writing function components, consider allowing both camelCase and PascalCase for functions.
589
+
590
+ ```json
591
+ {
592
+ "@typescript-eslint/naming-convention": [
593
+ "error",
594
+ {
595
+ "selector": "function",
596
+ "format": ["camelCase", "PascalCase"]
597
+ }
598
+ ]
599
+ }
600
+ ```
601
+
586
602
  ### Enforce that variable and function names are in camelCase
587
603
 
588
604
  This allows you to lint multiple type with same pattern.
@@ -10,7 +10,7 @@ import TabItem from '@theme/TabItem';
10
10
  > See **https://typescript-eslint.io/rules/no-base-to-string** for documentation.
11
11
 
12
12
  JavaScript will call `toString()` on an object when it is converted to a string, such as when `+` adding to a string or in `${}` template literals.
13
- The default Object `.toString()` returns `"[object Object]"`, which is often not what was intended.
13
+ The default Object `.toString()` uses the format `"[object Object]"`, which is often not what was intended.
14
14
  This rule reports on stringified values that aren't primitives and don't define a more useful `.toString()` method.
15
15
 
16
16
  > Note that `Function` provides its own `.toString()` that returns the function's code.
@@ -1,6 +1,6 @@
1
1
  :::danger Deprecated
2
2
 
3
- This rule has been deprecated in favour of the [`import/no-duplicates`](https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/no-duplicates.mdx) rule.
3
+ This rule has been deprecated in favour of the [`import/no-duplicates`](https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/no-duplicates.md) rule.
4
4
 
5
5
  :::
6
6
 
@@ -11,9 +11,13 @@ import TabItem from '@theme/TabItem';
11
11
 
12
12
  Deleting dynamically computed keys can be dangerous and in some cases not well optimized.
13
13
  Using the `delete` operator on keys that aren't runtime constants could be a sign that you're using the wrong data structures.
14
- Using `Object`s with added and removed keys can cause occasional edge case bugs, such as if a key is named `"hasOwnProperty"`.
14
+ Consider using a `Map` or `Set` if you’re using an object as a key-value collection.
15
15
 
16
- > Consider using a `Map` or `Set` if you’re storing collections of objects.
16
+ Dynamically adding and removing keys from objects can cause occasional edge case bugs. For example, some objects use "hidden properties" (such as `__data`) for private storage, and deleting them can break the object's internal state. Furthermore, [`delete`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete) cannot remove inherited properties or non-configurable properties. This makes it interact badly with anything more complicated than a plain object:
17
+
18
+ - The [`length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) of an array is non-configurable, and deleting it is a runtime error.
19
+ - You can't remove properties on the prototype of an object, such as deleting methods from class instances.
20
+ - Sometimes, `delete` only removes the own property, leaving the inherited property intact. For example, deleting the [`name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name) property of a function only removes the own property, but there's also a `Function.prototype.name` property that remains.
17
21
 
18
22
  ## Examples
19
23
 
@@ -9,6 +9,12 @@ import TabItem from '@theme/TabItem';
9
9
  >
10
10
  > See **https://typescript-eslint.io/rules/no-empty-interface** for documentation.
11
11
 
12
+ :::danger Deprecated
13
+
14
+ This rule has been deprecated in favour of the more comprehensive [`@typescript-eslint/no-empty-object-type`](./no-empty-object-type.mdx) rule.
15
+
16
+ :::
17
+
12
18
  An empty interface in TypeScript does very little: any non-nullable value is assignable to `{}`.
13
19
  Using an empty interface is often a sign of programmer error, such as misunderstanding the concept of `{}` or forgetting to fill in fields.
14
20
 
@@ -61,3 +67,7 @@ interface Baz extends Foo, Bar {}
61
67
  ## When Not To Use It
62
68
 
63
69
  If you don't care about having empty/meaningless interfaces, then you will not need this rule.
70
+
71
+ ## Related To
72
+
73
+ - [`no-empty-object-type`](./no-empty-object-type.mdx)
@@ -0,0 +1,145 @@
1
+ ---
2
+ description: 'Disallow accidentally using the "empty object" type.'
3
+ ---
4
+
5
+ import Tabs from '@theme/Tabs';
6
+ import TabItem from '@theme/TabItem';
7
+
8
+ > 🛑 This file is source code, not the primary documentation location! 🛑
9
+ >
10
+ > See **https://typescript-eslint.io/rules/no-empty-object-type** for documentation.
11
+
12
+ The `{}`, or "empty object" type in TypeScript is a common source of confusion for developers unfamiliar with TypeScript's structural typing.
13
+ `{}` represents any _non-nullish value_, including literals like `0` and `""`:
14
+
15
+ ```ts
16
+ let anyNonNullishValue: {} = 'Intentionally allowed by TypeScript.';
17
+ ```
18
+
19
+ Often, developers writing `{}` actually mean either:
20
+
21
+ - `object`: representing any _object_ value
22
+ - `unknown`: representing any value at all, including `null` and `undefined`
23
+
24
+ In other words, the "empty object" type `{}` really means _"any value that is defined"_.
25
+ That includes arrays, class instances, functions, and primitives such as `string` and `symbol`.
26
+
27
+ To avoid confusion around the `{}` type allowing any _non-nullish value_, this rule bans usage of the `{}` type.
28
+ That includes interfaces and object type aliases with no fields.
29
+
30
+ :::tip
31
+ If you do have a use case for an API allowing `{}`, you can always configure the [rule's options](#options), use an [ESLint disable comment](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1), or [disable the rule in your ESLint config](https://eslint.org/docs/latest/use/configure/rules#using-configuration-files-1).
32
+ :::
33
+
34
+ Note that this rule does not report on:
35
+
36
+ - `{}` as a type constituent in an intersection type (e.g. types like TypeScript's built-in `type NonNullable<T> = T & {}`), as this can be useful in type system operations.
37
+ - Interfaces that extend from multiple other interfaces.
38
+
39
+ ## Examples
40
+
41
+ <Tabs>
42
+ <TabItem value="❌ Incorrect">
43
+
44
+ ```ts
45
+ let anyObject: {};
46
+ let anyValue: {};
47
+
48
+ interface AnyObjectA {}
49
+ interface AnyValueA {}
50
+
51
+ type AnyObjectB = {};
52
+ type AnyValueB = {};
53
+ ```
54
+
55
+ </TabItem>
56
+ <TabItem value="✅ Correct">
57
+
58
+ ```ts
59
+ let anyObject: object;
60
+ let anyValue: unknown;
61
+
62
+ type AnyObjectA = object;
63
+ type AnyValueA = unknown;
64
+
65
+ type AnyObjectB = object;
66
+ type AnyValueB = unknown;
67
+
68
+ let objectWith: { property: boolean };
69
+
70
+ interface InterfaceWith {
71
+ property: boolean;
72
+ }
73
+
74
+ type TypeWith = { property: boolean };
75
+ ```
76
+
77
+ </TabItem>
78
+ </Tabs>
79
+
80
+ ## Options
81
+
82
+ By default, this rule flags both interfaces and object types.
83
+
84
+ ### `allowInterfaces`
85
+
86
+ Whether to allow empty interfaces, as one of:
87
+
88
+ - `'always'`: to always allow interfaces with no fields
89
+ - `'never'` _(default)_: to never allow interfaces with no fields
90
+ - `'with-single-extends'`: to allow empty interfaces that `extend` from a single base interface
91
+
92
+ Examples of **correct** code for this rule with `{ allowInterfaces: 'with-single-extends' }`:
93
+
94
+ ```ts option='{ "allowInterfaces": "with-single-extends" }' showPlaygroundButton
95
+ interface Base {
96
+ value: boolean;
97
+ }
98
+
99
+ interface Derived extends Base {}
100
+ ```
101
+
102
+ ### `allowObjectTypes`
103
+
104
+ Whether to allow empty object type literals, as one of:
105
+
106
+ - `'always'`: to always allow object type literals with no fields
107
+ - `'never'` _(default)_: to never allow object type literals with no fields
108
+
109
+ ### `allowWithName`
110
+
111
+ A stringified regular expression to allow interfaces and object type aliases with the configured name.
112
+ This can be useful if your existing code style includes a pattern of declaring empty types with `{}` instead of `object`.
113
+
114
+ Examples of code for this rule with `{ allowWithName: 'Props$' }`:
115
+
116
+ <Tabs>
117
+ <TabItem value="❌ Incorrect">
118
+
119
+ ```ts option='{ "allowWithName": "Props$" }' showPlaygroundButton
120
+ interface InterfaceValue {}
121
+
122
+ type TypeValue = {};
123
+ ```
124
+
125
+ </TabItem>
126
+ <TabItem value="✅ Correct">
127
+
128
+ ```ts option='{ "allowWithName": "Props$" }' showPlaygroundButton
129
+ interface InterfaceProps {}
130
+
131
+ type TypeProps = {};
132
+ ```
133
+
134
+ </TabItem>
135
+ </Tabs>
136
+
137
+ ## When Not To Use It
138
+
139
+ If your code commonly needs to represent the _"any non-nullish value"_ type, this rule may not be for you.
140
+ Projects that extensively use type operations such as conditional types and mapped types oftentimes benefit from disabling this rule.
141
+
142
+ ## Further Reading
143
+
144
+ - [Enhancement: [ban-types] Split the {} ban into a separate, better-phrased rule](https://github.com/typescript-eslint/typescript-eslint/issues/8700)
145
+ - [The Empty Object Type in TypeScript](https://www.totaltypescript.com/the-empty-object-type-in-typescript)
@@ -17,13 +17,14 @@ Valid ways of handling a Promise-valued statement include:
17
17
 
18
18
  - `await`ing it
19
19
  - `return`ing it
20
+ - `void`ing it
20
21
  - Calling its `.then()` with two arguments
21
22
  - Calling its `.catch()` with one argument
22
23
 
23
24
  This rule also reports when an Array containing Promises is created and not properly handled. The main way to resolve this is by using one of the Promise concurrency methods to create a single Promise, then handling that according to the procedure above. These methods include:
24
25
 
25
- - `Promise.all()`,
26
- - `Promise.allSettled()`,
26
+ - `Promise.all()`
27
+ - `Promise.allSettled()`
27
28
  - `Promise.any()`
28
29
  - `Promise.race()`
29
30
 
@@ -63,6 +64,9 @@ await promise;
63
64
  async function returnsPromise() {
64
65
  return 'value';
65
66
  }
67
+
68
+ void returnsPromise();
69
+
66
70
  returnsPromise().then(
67
71
  () => {},
68
72
  () => {},
@@ -82,7 +86,7 @@ await Promise.all([1, 2, 3].map(async x => x + 1));
82
86
 
83
87
  ### `ignoreVoid`
84
88
 
85
- This allows you to stop the rule reporting promises consumed with void operator.
89
+ This option, which is `true` by default, allows you to stop the rule reporting promises consumed with void operator.
86
90
  This can be a good way to explicitly mark a promise as intentionally not awaited.
87
91
 
88
92
  Examples of **correct** code for this rule with `{ ignoreVoid: true }`:
@@ -100,7 +104,7 @@ With this option set to `true`, and if you are using `no-void`, you should turn
100
104
 
101
105
  ### `ignoreIIFE`
102
106
 
103
- This allows you to skip checking of async IIFEs (Immediately Invoked function Expressions).
107
+ This allows you to skip checking of async IIFEs (Immediately Invoked Function Expressions).
104
108
 
105
109
  Examples of **correct** code for this rule with `{ ignoreIIFE: true }`:
106
110
 
@@ -115,6 +119,101 @@ await (async function () {
115
119
  })();
116
120
  ```
117
121
 
122
+ ### `allowForKnownSafePromises`
123
+
124
+ This option allows marking specific types as "safe" to be floating. For example, you may need to do this in the case of libraries whose APIs return Promises whose rejections are safely handled by the library.
125
+
126
+ This option takes an array of type specifiers to consider safe.
127
+ Each item in the array must have one of the following forms:
128
+
129
+ - A type defined in a file (`{ from: "file", name: "Foo", path: "src/foo-file.ts" }` with `path` being an optional path relative to the project root directory)
130
+ - A type from the default library (`{ from: "lib", name: "PromiseLike" }`)
131
+ - A type from a package (`{ from: "package", name: "Foo", package: "foo-lib" }`, this also works for types defined in a typings package).
132
+
133
+ Examples of code for this rule with:
134
+
135
+ ```json
136
+ {
137
+ "allowForKnownSafePromises": [
138
+ { "from": "file", "name": "SafePromise" },
139
+ { "from": "lib", "name": "PromiseLike" },
140
+ { "from": "package", "name": "Bar", "package": "bar-lib" }
141
+ ]
142
+ }
143
+ ```
144
+
145
+ <Tabs>
146
+ <TabItem value="❌ Incorrect">
147
+
148
+ ```ts option='{"allowForKnownSafePromises":[{"from":"file","name":"SafePromise"},{"from":"lib","name":"PromiseLike"},{"from":"package","name":"Bar","package":"bar-lib"}]}'
149
+ let promise: Promise<number> = Promise.resolve(2);
150
+ promise;
151
+
152
+ function returnsPromise(): Promise<number> {
153
+ return Promise.resolve(42);
154
+ }
155
+
156
+ returnsPromise();
157
+ ```
158
+
159
+ </TabItem>
160
+ <TabItem value="✅ Correct">
161
+
162
+ ```ts option='{"allowForKnownSafePromises":[{"from":"file","name":"SafePromise"},{"from":"lib","name":"PromiseLike"},{"from":"package","name":"Bar","package":"bar-lib"}]}'
163
+ // promises can be marked as safe by using branded types
164
+ type SafePromise = Promise<number> & { __linterBrands?: string };
165
+
166
+ let promise: SafePromise = Promise.resolve(2);
167
+ promise;
168
+
169
+ function returnsSafePromise(): SafePromise {
170
+ return Promise.resolve(42);
171
+ }
172
+
173
+ returnsSafePromise();
174
+ ```
175
+
176
+ </TabItem>
177
+ </Tabs>
178
+
179
+ ### `allowForKnownSafeCalls`
180
+
181
+ This option allows marking specific functions as "safe" to be called to create floating Promises.
182
+ For example, you may need to do this in the case of libraries whose APIs may be called without handling the resultant Promises.
183
+
184
+ This option takes the same array format as [`allowForKnownSafePromises`](#allowForKnownSafePromises).
185
+
186
+ Examples of code for this rule with:
187
+
188
+ ```json
189
+ {
190
+ "allowForKnownSafeCalls": [
191
+ { "from": "file", "name": "safe", "path": "input.ts" }
192
+ ]
193
+ }
194
+ ```
195
+
196
+ <Tabs>
197
+ <TabItem value="❌ Incorrect">
198
+
199
+ ```ts option='{"allowForKnownSafeCalls":[{"from":"file","name":"safe","path":"input.ts"}]}'
200
+ declare function unsafe(...args: unknown[]): Promise<void>;
201
+
202
+ unsafe('...', () => {});
203
+ ```
204
+
205
+ </TabItem>
206
+ <TabItem value="✅ Correct">
207
+
208
+ ```ts option='{"allowForKnownSafeCalls":[{"from":"file","name":"safe","path":"input.ts"}]}' skipValidation
209
+ declare function safe(...args: unknown[]): Promise<void>;
210
+
211
+ safe('...', () => {});
212
+ ```
213
+
214
+ </TabItem>
215
+ </Tabs>
216
+
118
217
  ## When Not To Use It
119
218
 
120
219
  This rule can be difficult to enable on large existing projects that set up many floating Promises.
@@ -76,5 +76,5 @@ If you're not using TypeScript 5.0's `verbatimModuleSyntax` option and your proj
76
76
  ## Related To
77
77
 
78
78
  - [`consistent-type-imports`](./consistent-type-imports.mdx)
79
- - [`import/consistent-type-specifier-style`](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/consistent-type-specifier-style.mdx)
79
+ - [`import/consistent-type-specifier-style`](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/consistent-type-specifier-style.md)
80
80
  - [`import/no-duplicates` with `{"prefer-inline": true}`](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-duplicates.md#inline-type-imports)
@@ -127,19 +127,18 @@ Examples of code for this rule with `checksVoidReturn: true`:
127
127
 
128
128
  ```ts option='{ "checksVoidReturn": true }'
129
129
  [1, 2, 3].forEach(async value => {
130
- await doSomething(value);
130
+ await fetch(`/${value}`);
131
131
  });
132
132
 
133
- new Promise(async (resolve, reject) => {
134
- await doSomething();
133
+ new Promise<void>(async (resolve, reject) => {
134
+ await fetch('/');
135
135
  resolve();
136
136
  });
137
137
 
138
- const eventEmitter = new EventEmitter();
139
- eventEmitter.on('some-event', async () => {
140
- synchronousCall();
141
- await doSomething();
142
- otherSynchronousCall();
138
+ document.addEventListener('click', async () => {
139
+ console.log('synchronous call');
140
+ await fetch('/');
141
+ console.log('synchronous call');
143
142
  });
144
143
  ```
145
144
 
@@ -169,8 +168,7 @@ new Promise((resolve, reject) => {
169
168
  });
170
169
 
171
170
  // Name the async wrapper to call it later
172
- const eventEmitter = new EventEmitter();
173
- eventEmitter.on('some-event', () => {
171
+ document.addEventListener('click', () => {
174
172
  const handler = async () => {
175
173
  await doSomething();
176
174
  otherSynchronousCall();
@@ -210,30 +208,30 @@ Examples of code for this rule with `checksSpreads: true`:
210
208
  <TabItem value="❌ Incorrect">
211
209
 
212
210
  ```ts option='{ "checksSpreads": true }'
213
- const getData = () => someAsyncOperation({ myArg: 'foo' });
211
+ const getData = () => fetch('/');
214
212
 
215
- return { foo: 42, ...getData() };
213
+ console.log({ foo: 42, ...getData() });
216
214
 
217
- const getData2 = async () => {
218
- await someAsyncOperation({ myArg: 'foo' });
215
+ const awaitData = async () => {
216
+ await fetch('/');
219
217
  };
220
218
 
221
- return { foo: 42, ...getData2() };
219
+ console.log({ foo: 42, ...awaitData() });
222
220
  ```
223
221
 
224
222
  </TabItem>
225
223
  <TabItem value="✅ Correct">
226
224
 
227
225
  ```ts option='{ "checksSpreads": true }'
228
- const getData = () => someAsyncOperation({ myArg: 'foo' });
226
+ const getData = () => fetch('/');
229
227
 
230
- return { foo: 42, ...(await getData()) };
228
+ console.log({ foo: 42, ...(await getData()) });
231
229
 
232
- const getData2 = async () => {
233
- await someAsyncOperation({ myArg: 'foo' });
230
+ const awaitData = async () => {
231
+ await fetch('/');
234
232
  };
235
233
 
236
- return { foo: 42, ...(await getData2()) };
234
+ console.log({ foo: 42, ...(await awaitData()) });
237
235
  ```
238
236
 
239
237
  </TabItem>
@@ -38,7 +38,7 @@ import * as lib3 from 'lib3';
38
38
 
39
39
  ### `allow`
40
40
 
41
- A array of strings. These strings will be compiled into regular expressions with the `u` flag and be used to test against the imported path. A common use case is to allow importing `package.json`. This is because `package.json` commonly lives outside of the TS root directory, so statically importing it would lead to root directory conflicts, especially with `resolveJsonModule` enabled. You can also use it to allow importing any JSON if your environment doesn't support JSON modules, or use it for other cases where `import` statements cannot work.
41
+ An array of strings. These strings will be compiled into regular expressions with the `u` flag and be used to test against the imported path. A common use case is to allow importing `package.json`. This is because `package.json` commonly lives outside of the TS root directory, so statically importing it would lead to root directory conflicts, especially with `resolveJsonModule` enabled. You can also use it to allow importing any JSON if your environment doesn't support JSON modules, or use it for other cases where `import` statements cannot work.
42
42
 
43
43
  With `{allow: ['/package\\.json$']}`:
44
44
 
@@ -59,6 +59,33 @@ console.log(require('../package.json').version);
59
59
  </TabItem>
60
60
  </Tabs>
61
61
 
62
+ ### `allowAsImport`
63
+
64
+ When set to `true`, the `import x = require(...)` declaration won't be reported.
65
+ This is useful if you use certain module options that require strict CommonJS interop semantics.
66
+
67
+ With `{allowAsImport: true}`:
68
+
69
+ <Tabs>
70
+ <TabItem value="❌ Incorrect">
71
+
72
+ ```ts option='{ "allowAsImport": true }'
73
+ var foo = require('foo');
74
+ const foo = require('foo');
75
+ let foo = require('foo');
76
+ ```
77
+
78
+ </TabItem>
79
+ <TabItem value="✅ Correct">
80
+
81
+ ```ts option='{ "allowAsImport": true }'
82
+ import foo = require('foo');
83
+ import foo from 'foo';
84
+ ```
85
+
86
+ </TabItem>
87
+ </Tabs>
88
+
62
89
  ## When Not To Use It
63
90
 
64
91
  If your project frequently uses older CommonJS `require`s, then this rule might not be applicable to you.