Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 26 commits into from
Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9469803
:zap: enabled array-type
michael-radency Dec 2, 2022
3721797
:zap: await-thenable on
michael-radency Dec 2, 2022
b5442ce
:zap: ban-types on
michael-radency Dec 2, 2022
ae44257
Merge branch 'master' of https://github.com/n8n-io/n8n into n8n-5626-…
michael-radency Dec 2, 2022
a16a5df
:zap: default-param-last on
michael-radency Dec 2, 2022
7914d11
:zap: dot-notation on
michael-radency Dec 2, 2022
def2631
:zap: member-delimiter-style on
michael-radency Dec 2, 2022
98c60bf
Merge branch 'master' of https://github.com/n8n-io/n8n into n8n-5626-…
michael-radency Dec 2, 2022
f157794
:zap: no-duplicate-imports on
michael-radency Dec 2, 2022
24987a4
:zap: no-empty-interface on
michael-radency Dec 2, 2022
d1e0a77
:zap: no-floating-promises on
michael-radency Dec 2, 2022
f3ca250
:zap: no-for-in-array on
michael-radency Dec 2, 2022
9df0d34
:zap: no-invalid-void-type on
michael-radency Dec 2, 2022
961192c
:zap: no-loop-func on
michael-radency Dec 2, 2022
fe6ebb2
:zap: no-shadow on
michael-radency Dec 2, 2022
c0f1a8c
Merge branch 'master' of https://github.com/n8n-io/n8n into n8n-5626-…
michael-radency Dec 2, 2022
06f1e62
:zap: ban-ts-comment re enabled
michael-radency Dec 2, 2022
596be3c
:zap: @typescript-eslint/lines-between-class-members on
netroy Dec 2, 2022
3d098c5
address my own comment
netroy Dec 2, 2022
ce2e43d
@typescript-eslint/return-await on
netroy Dec 2, 2022
55504ba
@typescript-eslint/promise-function-async on
netroy Dec 2, 2022
a1f6d5b
@typescript-eslint/no-unnecessary-boolean-literal-compare on
netroy Dec 2, 2022
f7d4244
@typescript-eslint/no-unnecessary-type-assertion on
netroy Dec 2, 2022
f571b33
prefer-const on
netroy Dec 2, 2022
059bdd5
@typescript-eslint/prefer-optional-chain on
netroy Dec 2, 2022
2493d47
Merge remote-tracking branch 'origin/master' into n8n-5626-remove-lin…
netroy Dec 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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