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

@@ -9,10 +9,10 @@ import {
NodeApiError,
NodeOperationError,
} from 'n8n-workflow';
import { leadFields, leadOpeations } from './LeadDescription';
import { leadFields, leadOperations } from './LeadDescription';
import { intercomApiRequest, intercomApiRequestAllItems, validateJSON } from './GenericFunctions';
import { IAvatar, ILead, ILeadCompany } from './LeadInterface';
import { userFields, userOpeations } from './UserDescription';
import { userFields, userOperations } from './UserDescription';
import { IUser, IUserCompany } from './UserInterface';
import { companyFields, companyOperations } from './CompanyDescription';
import { ICompany } from './CompanyInteface';
@@ -64,8 +64,8 @@ export class Intercom implements INodeType {
],
default: 'user',
},
...leadOpeations,
...userOpeations,
...leadOperations,
...userOperations,
...companyOperations,
...userFields,
...leadFields,
@@ -79,13 +79,13 @@ export class Intercom implements INodeType {
// select them easily
async getCompanies(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = [];
let companies, response;
let response;
try {
response = await intercomApiRequest.call(this, '/companies', 'GET');
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}
companies = response.companies;
const companies = response.companies;
for (const company of companies) {
const companyName = company.name;
const companyId = company.company_id;
@@ -172,10 +172,10 @@ export class Intercom implements INodeType {
).customAttributesValues as IDataObject[];
if (customAttributesValues) {
const customAttributes = {};
for (let i = 0; i < customAttributesValues.length; i++) {
for (let index = 0; index < customAttributesValues.length; index++) {
// @ts-ignore
customAttributes[customAttributesValues[i].name] =
customAttributesValues[i].value;
customAttributes[customAttributesValues[index].name] =
customAttributesValues[index].value;
}
body.custom_attributes = customAttributes;
}
@@ -234,7 +234,7 @@ export class Intercom implements INodeType {
Object.assign(qs, filters);
try {
if (returnAll === true) {
if (returnAll) {
responseData = await intercomApiRequestAllItems.call(
this,
'contacts',
@@ -345,10 +345,10 @@ export class Intercom implements INodeType {
).customAttributesValues as IDataObject[];
if (customAttributesValues) {
const customAttributes = {};
for (let i = 0; i < customAttributesValues.length; i++) {
for (let index = 0; index < customAttributesValues.length; index++) {
// @ts-ignore
customAttributes[customAttributesValues[i].name] =
customAttributesValues[i].value;
customAttributes[customAttributesValues[index].name] =
customAttributesValues[index].value;
}
body.custom_attributes = customAttributes;
}
@@ -409,7 +409,7 @@ export class Intercom implements INodeType {
Object.assign(qs, filters);
try {
if (returnAll === true) {
if (returnAll) {
responseData = await intercomApiRequestAllItems.call(
this,
'users',
@@ -473,10 +473,10 @@ export class Intercom implements INodeType {
).customAttributesValues as IDataObject[];
if (customAttributesValues) {
const customAttributes = {};
for (let i = 0; i < customAttributesValues.length; i++) {
for (let index = 0; index < customAttributesValues.length; index++) {
// @ts-ignore
customAttributes[customAttributesValues[i].name] =
customAttributesValues[i].value;
customAttributes[customAttributesValues[index].name] =
customAttributesValues[index].value;
}
body.custom_attributes = customAttributes;
}
@@ -533,7 +533,7 @@ export class Intercom implements INodeType {
Object.assign(qs, filters);
try {
if (returnAll === true) {
if (returnAll) {
responseData = await intercomApiRequestAllItems.call(
this,
'companies',
@@ -566,7 +566,7 @@ export class Intercom implements INodeType {
try {
if (listBy === 'id') {
if (returnAll === true) {
if (returnAll) {
responseData = await intercomApiRequestAllItems.call(
this,
'users',
@@ -589,7 +589,7 @@ export class Intercom implements INodeType {
} else {
qs.type = 'users';
if (returnAll === true) {
if (returnAll) {
responseData = await intercomApiRequestAllItems.call(
this,
'users',