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

@@ -7,7 +7,7 @@ import type {
import type { OptionsWithUri } from 'request';
import type { IDataObject } from 'n8n-workflow';
import type { IDataObject, JsonObject } from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';
// Interface in n8n
@@ -176,7 +176,7 @@ export async function apiRequest(
try {
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}

View File

@@ -2024,7 +2024,11 @@ export class Telegram implements INodeType {
);
const fileName = filePath.split('/').pop();
const data = await this.helpers.prepareBinaryData(file.body, fileName);
const data = await this.helpers.prepareBinaryData(
file.body as Buffer,
fileName as string,
);
returnData.push({
json: responseData,
@@ -2035,7 +2039,7 @@ export class Telegram implements INodeType {
}
} else if (resource === 'chat' && operation === 'administrators') {
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData.result),
this.helpers.returnJsonArray(responseData.result as IDataObject[]),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -2043,7 +2047,7 @@ export class Telegram implements INodeType {
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject[]),
{ itemData: { item: i } },
);
returnData.push(...executionData);

View File

@@ -164,7 +164,6 @@ export class TelegramTrigger implements INodeType {
],
};
// @ts-ignore (because of request)
webhookMethods = {
default: {
async checkExists(this: IHookFunctions): Promise<boolean> {
@@ -281,7 +280,7 @@ export class TelegramTrigger implements INodeType {
const binaryData = await this.helpers.prepareBinaryData(
data as unknown as Buffer,
fileName,
fileName as string,
);
return {