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

@@ -5,7 +5,7 @@ import type {
IHookFunctions,
ILoadOptionsFunctions,
} from 'n8n-core';
import type { IDataObject } from 'n8n-workflow';
import type { IDataObject, JsonObject } from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';
export async function hunterApiRequest(
@@ -28,13 +28,13 @@ export async function hunterApiRequest(
json: true,
};
options = Object.assign({}, options, option);
if (Object.keys(options.body).length === 0) {
if (Object.keys(options.body as IDataObject).length === 0) {
delete options.body;
}
try {
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
@@ -59,7 +59,7 @@ export async function hunterApiRequestAllItems(
do {
responseData = await hunterApiRequest.call(this, method, resource, body, query);
returnData.push(responseData[propertyName]);
returnData.push(responseData[propertyName] as IDataObject);
query.offset += query.limit;
} while (
responseData.meta?.results !== undefined &&

View File

@@ -319,7 +319,7 @@ export class Hunter implements INodeType {
}
(tempReturnData.emails as IDataObject[]).push.apply(
tempReturnData.emails,
responseData[index].emails,
responseData[index].emails as IDataObject[],
);
}
@@ -337,7 +337,7 @@ export class Hunter implements INodeType {
if (Array.isArray(responseData)) {
for (const data of responseData) {
tempReturnData.push.apply(tempReturnData, data.emails);
tempReturnData.push.apply(tempReturnData, data.emails as IDataObject[]);
}
} else {
tempReturnData = responseData.emails;
@@ -366,7 +366,7 @@ export class Hunter implements INodeType {
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject[]),
{ itemData: { item: i } },
);