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

@@ -2,7 +2,7 @@ import type { IExecuteFunctions } from 'n8n-core';
import type { OptionsWithUri } from 'request';
import type { IDataObject, ILoadOptionsFunctions, IPollFunctions } from 'n8n-workflow';
import type { IDataObject, ILoadOptionsFunctions, IPollFunctions, JsonObject } from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';
import type { TDtableMetadataColumns, TDtableViewColumns, TEndpointVariableName } from './types';
@@ -97,7 +97,7 @@ export async function seaTableApiRequest(
json: true,
};
if (Object.keys(body).length === 0) {
if (Object.keys(body as IDataObject).length === 0) {
delete options.body;
}
@@ -108,7 +108,7 @@ export async function seaTableApiRequest(
try {
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
@@ -142,7 +142,7 @@ export async function setableApiRequestAllItems(
query,
)) as unknown as IRow[];
//@ts-ignore
returnData.push.apply(returnData, responseData[propertyName]);
returnData.push.apply(returnData, responseData[propertyName] as IDataObject[]);
query.start = +query.start + segment;
} while (responseData && responseData.length > segment - 1);
@@ -280,7 +280,7 @@ function rowFormatColumn(input: unknown): boolean | number | string | string[] |
return input;
} else if (Array.isArray(input) && input.every((i) => typeof i === 'object')) {
const returnItems = [] as string[];
input.every((i) => returnItems.push(i.display_value));
input.every((i) => returnItems.push(i.display_value as string));
return returnItems;
}