;
+
+ it('...', () => {}).finally(() => {});
+ `,
+ errors: [{ line: 4, messageId: 'floatingVoid' }],
+ options: [
+ {
+ allowForKnownSafeCalls: [
+ {
+ from: 'file',
+ name: 'it',
+ // https://github.com/typescript-eslint/typescript-eslint/pull/9234/files#r1626465054
+ path: process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE
+ ? 'file.ts'
+ : 'tests/fixtures/file.ts',
+ },
+ ],
+ },
+ ],
+ },
],
});
diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-floating-promises.shot b/packages/eslint-plugin/tests/schema-snapshots/no-floating-promises.shot
index a708c7001d5b..b73c2638b92e 100644
--- a/packages/eslint-plugin/tests/schema-snapshots/no-floating-promises.shot
+++ b/packages/eslint-plugin/tests/schema-snapshots/no-floating-promises.shot
@@ -8,6 +8,100 @@ exports[`Rule schemas should be convertible to TS types for documentation purpos
{
"additionalProperties": false,
"properties": {
+ "allowForKnownSafeCalls": {
+ "items": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "from": {
+ "enum": ["file"],
+ "type": "string"
+ },
+ "name": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "items": {
+ "type": "string"
+ },
+ "minItems": 1,
+ "type": "array",
+ "uniqueItems": true
+ }
+ ]
+ },
+ "path": {
+ "type": "string"
+ }
+ },
+ "required": ["from", "name"],
+ "type": "object"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "from": {
+ "enum": ["lib"],
+ "type": "string"
+ },
+ "name": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "items": {
+ "type": "string"
+ },
+ "minItems": 1,
+ "type": "array",
+ "uniqueItems": true
+ }
+ ]
+ }
+ },
+ "required": ["from", "name"],
+ "type": "object"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "from": {
+ "enum": ["package"],
+ "type": "string"
+ },
+ "name": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "items": {
+ "type": "string"
+ },
+ "minItems": 1,
+ "type": "array",
+ "uniqueItems": true
+ }
+ ]
+ },
+ "package": {
+ "type": "string"
+ }
+ },
+ "required": ["from", "name", "package"],
+ "type": "object"
+ }
+ ]
+ },
+ "type": "array"
+ },
"allowForKnownSafePromises": {
"items": {
"oneOf": [
@@ -120,6 +214,23 @@ exports[`Rule schemas should be convertible to TS types for documentation purpos
type Options = [
{
+ allowForKnownSafeCalls?: (
+ | {
+ from: 'file';
+ name: [string, ...string[]] | string;
+ path?: string;
+ }
+ | {
+ from: 'lib';
+ name: [string, ...string[]] | string;
+ }
+ | {
+ from: 'package';
+ name: [string, ...string[]] | string;
+ package: string;
+ }
+ | string
+ )[];
allowForKnownSafePromises?: (
| {
from: 'file';
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy