refactor(core): Remove linting exceptions in nodes-base (#4794)

*  enabled array-type

*  await-thenable on

*  ban-types on

*  default-param-last on

*  dot-notation on

*  member-delimiter-style on

*  no-duplicate-imports on

*  no-empty-interface on

*  no-floating-promises on

*  no-for-in-array on

*  no-invalid-void-type on

*  no-loop-func on

*  no-shadow on

*  ban-ts-comment re enabled

*  @typescript-eslint/lines-between-class-members on

* address my own comment

* @typescript-eslint/return-await on

* @typescript-eslint/promise-function-async on

* @typescript-eslint/no-unnecessary-boolean-literal-compare on

* @typescript-eslint/no-unnecessary-type-assertion on

* prefer-const on

* @typescript-eslint/prefer-optional-chain on

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
Michael Kret
2022-12-02 22:54:28 +02:00
committed by GitHub
parent 8101c05d6f
commit 61e26804ba
796 changed files with 3735 additions and 2847 deletions

View File

@@ -330,11 +330,11 @@ export class ApiTemplateIo implements INodeType {
methods = {
loadOptions: {
async getImageTemplates(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
return await loadResource.call(this, 'image');
return loadResource.call(this, 'image');
},
async getPdfTemplates(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
return await loadResource.call(this, 'pdf');
return loadResource.call(this, 'pdf');
},
},
};
@@ -401,16 +401,15 @@ export class ApiTemplateIo implements INodeType {
const body = { overrides: [] } as IDataObject;
if (jsonParameters === false) {
if (!jsonParameters) {
const overrides =
(((this.getNodeParameter('overridesUi', i) as IDataObject) || {})
.overrideValues as IDataObject[]) || [];
((this.getNodeParameter('overridesUi', i) as IDataObject)
?.overrideValues as IDataObject[]) || [];
if (overrides.length !== 0) {
const data: IDataObject[] = [];
for (const override of overrides) {
const properties =
(((override.propertiesUi as IDataObject) || {})
.propertyValues as IDataObject[]) || [];
((override.propertiesUi as IDataObject)?.propertyValues as IDataObject[]) || [];
data.push(
properties.reduce(
(obj, value) => Object.assign(obj, { [`${value.key}`]: value.value }),
@@ -435,7 +434,7 @@ export class ApiTemplateIo implements INodeType {
responseData = await apiTemplateIoApiRequest.call(this, 'POST', '/create', qs, body);
if (download === true) {
if (download) {
const binaryProperty = this.getNodeParameter('binaryProperty', i);
const data = await downloadImage.call(this, responseData.download_url);
const fileName = responseData.download_url.split('/').pop();
@@ -460,7 +459,7 @@ export class ApiTemplateIo implements INodeType {
}
}
if (download === true) {
if (download) {
return this.prepareOutputData(returnData as unknown as INodeExecutionData[]);
}
}
@@ -492,10 +491,10 @@ export class ApiTemplateIo implements INodeType {
let data;
if (jsonParameters === false) {
if (!jsonParameters) {
const properties =
(((this.getNodeParameter('propertiesUi', i) as IDataObject) || {})
.propertyValues as IDataObject[]) || [];
((this.getNodeParameter('propertiesUi', i) as IDataObject)
?.propertyValues as IDataObject[]) || [];
if (properties.length === 0) {
throw new NodeOperationError(
this.getNode(),
@@ -519,12 +518,12 @@ export class ApiTemplateIo implements INodeType {
responseData = await apiTemplateIoApiRequest.call(this, 'POST', '/create', qs, data);
if (download === true) {
if (download) {
const binaryProperty = this.getNodeParameter('binaryProperty', i);
const data = await downloadImage.call(this, responseData.download_url);
const imageData = await downloadImage.call(this, responseData.download_url);
const fileName = responseData.download_url.split('/').pop();
const binaryData = await this.helpers.prepareBinaryData(
data,
imageData,
options.fileName || fileName,
);
responseData = {
@@ -543,7 +542,7 @@ export class ApiTemplateIo implements INodeType {
throw error;
}
}
if (download === true) {
if (download) {
return this.prepareOutputData(returnData as unknown as INodeExecutionData[]);
}
}