fix(core): Remove linting exceptions in nodes-base, @typescript-eslint/no-unsafe-argument (no-changelog)

This commit is contained in:
Michael Kret
2023-02-28 05:39:43 +02:00
committed by GitHub
parent 3172ea376e
commit bb4db58819
560 changed files with 2227 additions and 1919 deletions

View File

@@ -1,6 +1,6 @@
import type { OptionsWithUri } from 'request';
import type { IDataObject } from 'n8n-workflow';
import type { IDataObject, JsonObject } from 'n8n-workflow';
import { NodeApiError, NodeOperationError } from 'n8n-workflow';
import type { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } from 'n8n-core';
@@ -46,9 +46,9 @@ export async function matrixApiRequest(
// When working with images, the request cannot be JSON (it's raw binary data)
// But the output is JSON so we have to parse it manually.
//@ts-ignore
return options.overridePrefix === 'media' ? JSON.parse(response) : response;
return options.overridePrefix === 'media' ? JSON.parse(response as string) : response;
} catch (error) {
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
@@ -148,7 +148,7 @@ export async function handleMatrixCall(
{},
qs,
);
returnData.push.apply(returnData, responseData.chunk);
returnData.push.apply(returnData, responseData.chunk as IDataObject[]);
from = responseData.end;
} while (responseData.chunk.length > 0);
} else {
@@ -169,7 +169,7 @@ export async function handleMatrixCall(
{},
qs,
);
returnData.push.apply(returnData, responseData.chunk);
returnData.push.apply(returnData, responseData.chunk as IDataObject[]);
}
return returnData;