You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/eslint-plugin/docs/rules/no-unsafe-return.mdx
+9-1
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ Using `any` disables many type checking rules and is generally best used only as
15
15
Despite your best intentions, the `any` type can sometimes leak into your codebase.
16
16
Returning an an `any`-typed value from a function creates a potential type safety hole and source of bugs in your codebase.
17
17
18
-
This rule disallows returning `any` or `any[]` from a function.
18
+
This rule disallows returning `any` or `any[]` from a function and returning `Promise<any>` from an async function.
19
19
20
20
This rule also compares generic type argument types to ensure you don't return an unsafe `any` in a generic position to a function that's expecting a specific type.
21
21
For example, it will error if you return `Set<any>` from a function declared as returning `Set<string>`.
0 commit comments