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-floating-promises.mdx
+57
Original file line number
Diff line number
Diff line change
@@ -119,6 +119,63 @@ await (async function () {
119
119
})();
120
120
```
121
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).
Copy file name to clipboardExpand all lines: packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.mdx
+5-4
Original file line number
Diff line number
Diff line change
@@ -142,11 +142,12 @@ interface Foo {
142
142
143
143
Some complex types cannot easily be made readonly, for example the `HTMLElement` type or the `JQueryStatic` type from `@types/jquery`. This option allows you to globally disable reporting of such types.
144
144
145
-
Each item must be one of:
145
+
This option takes an array of type specifiers to ignore.
146
+
Each item in the array must have one of the following forms:
146
147
147
-
- 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)
148
-
- A type from the default library (`{from: "lib", name: "Foo"}`)
149
-
- A type from a package (`{from: "package", name: "Foo", package: "foo-lib"}`, this also works for types defined in a typings package).
148
+
- 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)
149
+
- A type from the default library (`{from: "lib", name: "Foo"}`)
150
+
- A type from a package (`{from: "package", name: "Foo", package: "foo-lib"}`, this also works for types defined in a typings package).
150
151
151
152
Additionally, a type may be defined just as a simple string, which then matches the type independently of its origin.
0 commit comments