Skip to content

Commit

Permalink
refactor(core): Remove linting exceptions in nodes-base (#4794)
Browse files Browse the repository at this point in the history
* ⚡ 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: कारतोफ्फेलस्क्रिप्ट™ <[email protected]>
  • Loading branch information
michael-radency and netroy authored Dec 2, 2022
1 parent 8101c05 commit 61e2680
Show file tree
Hide file tree
Showing 796 changed files with 3,735 additions and 2,847 deletions.
24 changes: 2 additions & 22 deletions packages/nodes-base/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,14 @@ module.exports = {
'id-denylist': 'off',
'import/extensions': 'off',
'import/order': 'off',
'prefer-const': 'off',
'prefer-spread': 'off',
'import/no-extraneous-dependencies': 'off',

'@typescript-eslint/array-type': 'off',
'@typescript-eslint/await-thenable': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/default-param-last': 'off',
'@typescript-eslint/dot-notation': 'off',
'@typescript-eslint/lines-between-class-members': 'off',
'@typescript-eslint/member-delimiter-style': 'off',
'@typescript-eslint/naming-convention': ['error', { selector: 'memberLike', format: null }],
'@typescript-eslint/no-duplicate-imports': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-for-in-array': 'off',
'@typescript-eslint/no-invalid-void-type': 'off',
'@typescript-eslint/no-loop-func': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-shadow': 'off',
'@typescript-eslint/no-explicit-any': 'off', //812 warnings, better to fix in separate PR
'@typescript-eslint/no-non-null-assertion': 'off', //665 errors, better to fix in separate PR
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/no-throw-literal': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off',
'@typescript-eslint/no-unnecessary-qualifier': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
Expand All @@ -49,11 +32,8 @@ module.exports = {
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/prefer-optional-chain': 'off',
'@typescript-eslint/promise-function-async': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/return-await': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/ban-ts-comment': ['warn', { 'ts-ignore': true }],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ import {

export class ActionNetworkApi implements ICredentialType {
name = 'actionNetworkApi';

displayName = 'Action Network API';

documentationUrl = 'actionNetwork';

properties: INodeProperties[] = [
{
displayName: 'API Key',
Expand All @@ -19,12 +22,14 @@ export class ActionNetworkApi implements ICredentialType {
default: '',
},
];

test: ICredentialTestRequest = {
request: {
baseURL: 'https://actionnetwork.org/api/v2',
url: '/events?per_page=1',
},
};

async authenticate(
credentials: ICredentialDataDecryptedObject,
requestOptions: IHttpRequestOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ import {

export class ActiveCampaignApi implements ICredentialType {
name = 'activeCampaignApi';

displayName = 'ActiveCampaign API';

documentationUrl = 'activeCampaign';

properties: INodeProperties[] = [
{
displayName: 'API URL',
Expand All @@ -24,6 +27,7 @@ export class ActiveCampaignApi implements ICredentialType {
default: '',
},
];

authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
Expand All @@ -32,6 +36,7 @@ export class ActiveCampaignApi implements ICredentialType {
},
},
};

test: ICredentialTestRequest = {
request: {
baseURL: '={{$credentials.apiUrl}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { ICredentialType, INodeProperties } from 'n8n-workflow';

export class AcuitySchedulingApi implements ICredentialType {
name = 'acuitySchedulingApi';

displayName = 'Acuity Scheduling API';

documentationUrl = 'acuityScheduling';

properties: INodeProperties[] = [
{
displayName: 'User ID',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ import { ICredentialType, INodeProperties } from 'n8n-workflow';

export class AcuitySchedulingOAuth2Api implements ICredentialType {
name = 'acuitySchedulingOAuth2Api';

extends = ['oAuth2Api'];

displayName = 'AcuityScheduling OAuth2 API';

documentationUrl = 'acuityScheduling';

properties: INodeProperties[] = [
{
displayName: 'Grant Type',
Expand Down
3 changes: 3 additions & 0 deletions packages/nodes-base/credentials/AdaloApi.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { IAuthenticateGeneric, ICredentialType, INodeProperties } from 'n8n-work

export class AdaloApi implements ICredentialType {
name = 'adaloApi';

displayName = 'Adalo API';

documentationUrl = 'adalo';

properties: INodeProperties[] = [
{
displayName: 'API Key',
Expand Down
3 changes: 3 additions & 0 deletions packages/nodes-base/credentials/AffinityApi.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { ICredentialType, INodeProperties } from 'n8n-workflow';

export class AffinityApi implements ICredentialType {
name = 'affinityApi';

displayName = 'Affinity API';

documentationUrl = 'affinity';

properties: INodeProperties[] = [
{
displayName: 'API Key',
Expand Down
3 changes: 3 additions & 0 deletions packages/nodes-base/credentials/AgileCrmApi.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { ICredentialType, INodeProperties } from 'n8n-workflow';

export class AgileCrmApi implements ICredentialType {
name = 'agileCrmApi';

displayName = 'AgileCRM API';

documentationUrl = 'agileCrm';

properties: INodeProperties[] = [
{
displayName: 'Email',
Expand Down
4 changes: 4 additions & 0 deletions packages/nodes-base/credentials/AirtableApi.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { IAuthenticateGeneric, ICredentialType, INodeProperties } from 'n8n-work

export class AirtableApi implements ICredentialType {
name = 'airtableApi';

displayName = 'Airtable API';

documentationUrl = 'airtable';

properties: INodeProperties[] = [
{
displayName: 'API Key',
Expand All @@ -13,6 +16,7 @@ export class AirtableApi implements ICredentialType {
default: '',
},
];

authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
Expand Down
3 changes: 3 additions & 0 deletions packages/nodes-base/credentials/Amqp.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { ICredentialType, INodeProperties } from 'n8n-workflow';

export class Amqp implements ICredentialType {
name = 'amqp';

displayName = 'AMQP';

documentationUrl = 'amqp';

properties: INodeProperties[] = [
{
displayName: 'Hostname',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ import {

export class ApiTemplateIoApi implements ICredentialType {
name = 'apiTemplateIoApi';

displayName = 'APITemplate.io API';

documentationUrl = 'apiTemplateIo';

properties: INodeProperties[] = [
{
displayName: 'API Key',
Expand All @@ -18,6 +21,7 @@ export class ApiTemplateIoApi implements ICredentialType {
default: '',
},
];

authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
Expand All @@ -26,6 +30,7 @@ export class ApiTemplateIoApi implements ICredentialType {
},
},
};

test: ICredentialTestRequest = {
request: {
baseURL: 'https://api.apitemplate.io/v1',
Expand Down
3 changes: 3 additions & 0 deletions packages/nodes-base/credentials/AsanaApi.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { IAuthenticateGeneric, ICredentialType, INodeProperties } from 'n8n-work

export class AsanaApi implements ICredentialType {
name = 'asanaApi';

displayName = 'Asana API';

documentationUrl = 'asana';

properties: INodeProperties[] = [
{
displayName: 'Access Token',
Expand Down
4 changes: 4 additions & 0 deletions packages/nodes-base/credentials/AsanaOAuth2Api.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ import { ICredentialType, INodeProperties } from 'n8n-workflow';

export class AsanaOAuth2Api implements ICredentialType {
name = 'asanaOAuth2Api';

extends = ['oAuth2Api'];

displayName = 'Asana OAuth2 API';

documentationUrl = 'asana';

properties: INodeProperties[] = [
{
displayName: 'Grant Type',
Expand Down
3 changes: 3 additions & 0 deletions packages/nodes-base/credentials/AutomizyApi.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { ICredentialType, INodeProperties } from 'n8n-workflow';

export class AutomizyApi implements ICredentialType {
name = 'automizyApi';

displayName = 'Automizy API';

documentationUrl = 'automizy';

properties: INodeProperties[] = [
{
displayName: 'API Token',
Expand Down
3 changes: 3 additions & 0 deletions packages/nodes-base/credentials/AutopilotApi.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { ICredentialType, INodeProperties } from 'n8n-workflow';

export class AutopilotApi implements ICredentialType {
name = 'autopilotApi';

displayName = 'Autopilot API';

documentationUrl = 'autopilot';

properties: INodeProperties[] = [
{
displayName: 'API Key',
Expand Down
11 changes: 8 additions & 3 deletions packages/nodes-base/credentials/Aws.credentials.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Request, sign } from 'aws4';
import { ICredentialTestRequest } from 'n8n-workflow';

import {
ICredentialDataDecryptedObject,
ICredentialTestRequest,
ICredentialType,
IDataObject,
IHttpRequestOptions,
Expand Down Expand Up @@ -125,9 +126,13 @@ export type AWSRegion = typeof regions[number]['name'];

export class Aws implements ICredentialType {
name = 'aws';

displayName = 'AWS';

documentationUrl = 'aws';

icon = 'file:AWS.svg';

properties: INodeProperties[] = [
{
displayName: 'Region',
Expand Down Expand Up @@ -302,8 +307,8 @@ export class Aws implements ICredentialType {
} else {
// If no endpoint is set, we try to decompose the path and use the default endpoint
const customUrl = new URL(`${requestOptions.baseURL!}${requestOptions.url}${path ?? ''}`);
service = customUrl.hostname.split('.')[0] as string;
region = customUrl.hostname.split('.')[1] as string;
service = customUrl.hostname.split('.')[0];
region = customUrl.hostname.split('.')[1];
if (service === 'sts') {
try {
customUrl.searchParams.set('Action', 'GetCallerIdentity');
Expand Down
3 changes: 3 additions & 0 deletions packages/nodes-base/credentials/BambooHrApi.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { ICredentialType, INodeProperties } from 'n8n-workflow';

export class BambooHrApi implements ICredentialType {
name = 'bambooHrApi';

displayName = 'BambooHR API';

documentationUrl = 'bambooHr';

properties: INodeProperties[] = [
{
displayName: 'Subdomain',
Expand Down
3 changes: 3 additions & 0 deletions packages/nodes-base/credentials/BannerbearApi.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { ICredentialType, INodeProperties } from 'n8n-workflow';

export class BannerbearApi implements ICredentialType {
name = 'bannerbearApi';

displayName = 'Bannerbear API';

documentationUrl = 'bannerbear';

properties: INodeProperties[] = [
{
displayName: 'Project API Key',
Expand Down
2 changes: 2 additions & 0 deletions packages/nodes-base/credentials/BaserowApi.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { ICredentialType, INodeProperties } from 'n8n-workflow';

export class BaserowApi implements ICredentialType {
name = 'baserowApi';

displayName = 'Baserow API';

properties: INodeProperties[] = [
{
displayName: 'Host',
Expand Down
3 changes: 3 additions & 0 deletions packages/nodes-base/credentials/BeeminderApi.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ import {

export class BeeminderApi implements ICredentialType {
name = 'beeminderApi';

displayName = 'Beeminder API';

documentationUrl = 'beeminder';

properties: INodeProperties[] = [
{
displayName: 'User',
Expand Down
3 changes: 3 additions & 0 deletions packages/nodes-base/credentials/BitbucketApi.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { ICredentialType, INodeProperties } from 'n8n-workflow';

export class BitbucketApi implements ICredentialType {
name = 'bitbucketApi';

displayName = 'Bitbucket API';

documentationUrl = 'bitbucket';

properties: INodeProperties[] = [
{
displayName: 'Username',
Expand Down
3 changes: 3 additions & 0 deletions packages/nodes-base/credentials/BitlyApi.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { ICredentialType, INodeProperties } from 'n8n-workflow';

export class BitlyApi implements ICredentialType {
name = 'bitlyApi';

displayName = 'Bitly API';

documentationUrl = 'bitly';

properties: INodeProperties[] = [
{
displayName: 'Access Token',
Expand Down
4 changes: 4 additions & 0 deletions packages/nodes-base/credentials/BitlyOAuth2Api.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ import { ICredentialType, INodeProperties } from 'n8n-workflow';

export class BitlyOAuth2Api implements ICredentialType {
name = 'bitlyOAuth2Api';

displayName = 'Bitly OAuth2 API';

documentationUrl = 'bitly';

extends = ['oAuth2Api'];

properties: INodeProperties[] = [
{
displayName: 'Grant Type',
Expand Down
Loading

0 comments on commit 61e2680

Please sign in to comment.