refactor: Remove unused vars to fix build (no-changelog) (#4584)

* 🔥 Remove unused vars to fix build

* 👕 Make unused vars severity conditional
This commit is contained in:
Iván Ovejero 2022-11-11 16:07:50 +01:00 committed by GitHub
parent 277b6b73c3
commit 52f38df867
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 35 additions and 50 deletions

View file

@ -41,4 +41,6 @@ jobs:
pnpm test:e2e:ci:smoke pnpm test:e2e:ci:smoke
- name: Lint - name: Lint
env:
CI_LINT_MASTER: true
run: pnpm lint run: pnpm lint

View file

@ -359,12 +359,10 @@ const config = (module.exports = {
/** /**
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unused-vars.md * https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unused-vars.md
*
* Disabled because eslint-plugin-diff fails to catch it. TODO: Revisit.
*/ */
'no-unused-vars': 'off', 'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [ '@typescript-eslint/no-unused-vars': [
'error', process.env.CI_LINT_MASTER ? 'warn' : 'error',
{ {
argsIgnorePattern: '^_', argsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_',

View file

@ -1,6 +1,6 @@
import { IExecuteFunctions } from 'n8n-core'; import { IExecuteFunctions } from 'n8n-core';
import { IDataObject, ILoadOptionsFunctions, NodeApiError } from 'n8n-workflow'; import { IDataObject, ILoadOptionsFunctions } from 'n8n-workflow';
import { OptionsWithUri } from 'request'; import { OptionsWithUri } from 'request';

View file

@ -7,7 +7,6 @@ import {
IDataObject, IDataObject,
ILoadOptionsFunctions, ILoadOptionsFunctions,
INodeExecutionData, INodeExecutionData,
NodeApiError,
} from 'n8n-workflow'; } from 'n8n-workflow';
interface IAttachment { interface IAttachment {

View file

@ -7,8 +7,7 @@ import {
IWebhookFunctions, IWebhookFunctions,
} from 'n8n-core'; } from 'n8n-core';
import { IHttpRequestOptions } from 'n8n-workflow';
import { IHttpRequestOptions, NodeApiError } from 'n8n-workflow';
export async function awsApiRequest( export async function awsApiRequest(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions,

View file

@ -9,7 +9,7 @@ import {
IWebhookFunctions, IWebhookFunctions,
} from 'n8n-core'; } from 'n8n-core';
import { IDataObject, IHttpRequestOptions, NodeApiError } from 'n8n-workflow'; import { IDataObject, IHttpRequestOptions } from 'n8n-workflow';
import { pascalCase } from 'change-case'; import { pascalCase } from 'change-case';

View file

@ -9,7 +9,7 @@ import {
IWebhookFunctions, IWebhookFunctions,
} from 'n8n-core'; } from 'n8n-core';
import { IDataObject, IHttpRequestOptions, JsonObject, NodeApiError } from 'n8n-workflow'; import { IDataObject, IHttpRequestOptions } from 'n8n-workflow';
export async function awsApiRequest( export async function awsApiRequest(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions,

View file

@ -2,7 +2,7 @@ import { OptionsWithUri } from 'request';
import { IExecuteFunctions, ILoadOptionsFunctions } from 'n8n-core'; import { IExecuteFunctions, ILoadOptionsFunctions } from 'n8n-core';
import { IDataObject, IHookFunctions, IWebhookFunctions, NodeApiError } from 'n8n-workflow'; import { IDataObject, IHookFunctions, IWebhookFunctions } from 'n8n-workflow';
const BEEMINDER_URI = 'https://www.beeminder.com/api/v1'; const BEEMINDER_URI = 'https://www.beeminder.com/api/v1';

View file

@ -8,7 +8,6 @@ import {
IDataObject, IDataObject,
IHookFunctions, IHookFunctions,
IWebhookFunctions, IWebhookFunctions,
NodeApiError,
} from 'n8n-workflow'; } from 'n8n-workflow';
export async function calendlyApiRequest( export async function calendlyApiRequest(

View file

@ -2,7 +2,7 @@ import { OptionsWithUri } from 'request';
import { IExecuteFunctions, ILoadOptionsFunctions, IPollFunctions } from 'n8n-core'; import { IExecuteFunctions, ILoadOptionsFunctions, IPollFunctions } from 'n8n-core';
import { IDataObject, NodeApiError } from 'n8n-workflow'; import { IDataObject } from 'n8n-workflow';
export async function clockifyApiRequest( export async function clockifyApiRequest(
this: ILoadOptionsFunctions | IPollFunctions | IExecuteFunctions, this: ILoadOptionsFunctions | IPollFunctions | IExecuteFunctions,

View file

@ -7,7 +7,7 @@ import {
ILoadOptionsFunctions, ILoadOptionsFunctions,
} from 'n8n-core'; } from 'n8n-core';
import { IDataObject, NodeApiError } from 'n8n-workflow'; import { IDataObject } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment';

View file

@ -1,6 +1,6 @@
import { IExecuteFunctions, IHookFunctions, ILoadOptionsFunctions } from 'n8n-core'; import { IExecuteFunctions, IHookFunctions, ILoadOptionsFunctions } from 'n8n-core';
import { IDataObject, IHttpRequestMethods, IHttpRequestOptions, NodeApiError } from 'n8n-workflow'; import { IDataObject, IHttpRequestMethods, IHttpRequestOptions } from 'n8n-workflow';
import { get } from 'lodash'; import { get } from 'lodash';

View file

@ -1,6 +1,6 @@
import { IExecuteFunctions, IHookFunctions } from 'n8n-core'; import { IExecuteFunctions, IHookFunctions } from 'n8n-core';
import { IDataObject, ILoadOptionsFunctions, NodeApiError } from 'n8n-workflow'; import { IDataObject, ILoadOptionsFunctions } from 'n8n-workflow';
import { OptionsWithUri } from 'request'; import { OptionsWithUri } from 'request';

View file

@ -7,7 +7,7 @@ import {
ILoadOptionsFunctions, ILoadOptionsFunctions,
} from 'n8n-core'; } from 'n8n-core';
import { IDataObject, JsonObject, NodeApiError } from 'n8n-workflow'; import { IDataObject } from 'n8n-workflow';
export async function ghostApiRequest( export async function ghostApiRequest(
this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,

View file

@ -7,7 +7,7 @@ import {
ILoadOptionsFunctions, ILoadOptionsFunctions,
} from 'n8n-core'; } from 'n8n-core';
import { IDataObject, JsonObject, NodeApiError } from 'n8n-workflow'; import { IDataObject } from 'n8n-workflow';
export async function jiraSoftwareCloudApiRequest( export async function jiraSoftwareCloudApiRequest(
this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,

View file

@ -1,6 +1,6 @@
import { IExecuteFunctions, IHookFunctions } from 'n8n-core'; import { IExecuteFunctions, IHookFunctions } from 'n8n-core';
import { IDataObject, ILoadOptionsFunctions, NodeApiError } from 'n8n-workflow'; import { IDataObject, ILoadOptionsFunctions } from 'n8n-workflow';
import { OptionsWithUri } from 'request'; import { OptionsWithUri } from 'request';

View file

@ -2,7 +2,7 @@ import { OptionsWithUri } from 'request';
import { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } from 'n8n-core'; import { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } from 'n8n-core';
import { IDataObject, IHookFunctions, JsonObject, NodeApiError } from 'n8n-workflow'; import { IDataObject, IHookFunctions } from 'n8n-workflow';
export async function mailjetApiRequest( export async function mailjetApiRequest(
this: IExecuteFunctions | IExecuteSingleFunctions | IHookFunctions | ILoadOptionsFunctions, this: IExecuteFunctions | IExecuteSingleFunctions | IHookFunctions | ILoadOptionsFunctions,

View file

@ -1,7 +1,5 @@
import { IExecuteFunctions, IHookFunctions } from 'n8n-core'; import { IExecuteFunctions, IHookFunctions } from 'n8n-core';
import { JsonObject, NodeApiError } from 'n8n-workflow';
import { OptionsWithUri } from 'request'; import { OptionsWithUri } from 'request';
/** /**

View file

@ -8,7 +8,6 @@ import {
INodeExecutionData, INodeExecutionData,
IPollFunctions, IPollFunctions,
jsonParse, jsonParse,
NodeApiError,
NodeOperationError, NodeOperationError,
} from 'n8n-workflow'; } from 'n8n-workflow';

View file

@ -1,13 +1,6 @@
import { IPollFunctions } from 'n8n-core'; import { IPollFunctions } from 'n8n-core';
import { import { IDataObject, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
IDataObject,
ILoadOptionsFunctions,
INodeExecutionData,
INodePropertyOptions,
INodeType,
INodeTypeDescription,
} from 'n8n-workflow';
import { notionApiRequest, simplifyObjects } from './GenericFunctions'; import { notionApiRequest, simplifyObjects } from './GenericFunctions';
@ -89,14 +82,15 @@ export class NotionTrigger implements INodeType {
type: 'regex', type: 'regex',
properties: { properties: {
regex: regex:
'(?:https|http):\/\/www.notion.so\/(?:[a-z0-9\-]{2,}\/)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*', '(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*',
errorMessage: 'Not a valid Notion Database URL', errorMessage: 'Not a valid Notion Database URL',
}, },
}, },
], ],
extractValue: { extractValue: {
type: 'regex', type: 'regex',
regex: '(?:https|http):\/\/www.notion.so\/(?:[a-z0-9\-]{2,}\/)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})', regex:
'(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})',
}, },
}, },
{ {
@ -108,7 +102,8 @@ export class NotionTrigger implements INodeType {
{ {
type: 'regex', type: 'regex',
properties: { properties: {
regex: '^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*', regex:
'^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*',
errorMessage: 'Not a valid Notion Database ID', errorMessage: 'Not a valid Notion Database ID',
}, },
}, },
@ -125,7 +120,7 @@ export class NotionTrigger implements INodeType {
event: ['pageAddedToDatabase', 'pagedUpdatedInDatabase'], event: ['pageAddedToDatabase', 'pagedUpdatedInDatabase'],
}, },
}, },
description: "The Notion Database to operate on", description: 'The Notion Database to operate on',
}, },
{ {
displayName: 'Simplify', displayName: 'Simplify',

View file

@ -1,7 +1,6 @@
import { OptionsWithUri } from 'request'; import { OptionsWithUri } from 'request';
import { IExecuteFunctions, ILoadOptionsFunctions } from 'n8n-core'; import { IExecuteFunctions, ILoadOptionsFunctions } from 'n8n-core';
import { NodeApiError } from 'n8n-workflow';
export async function rocketchatApiRequest( export async function rocketchatApiRequest(
this: IExecuteFunctions | ILoadOptionsFunctions, this: IExecuteFunctions | ILoadOptionsFunctions,

View file

@ -6,7 +6,7 @@ import {
ILoadOptionsFunctions, ILoadOptionsFunctions,
IWebhookFunctions, IWebhookFunctions,
} from 'n8n-core'; } from 'n8n-core';
import { IDataObject, NodeApiError } from 'n8n-workflow'; import { IDataObject } from 'n8n-workflow';
export async function segmentApiRequest( export async function segmentApiRequest(
this: this:

View file

@ -7,7 +7,7 @@ import {
ILoadOptionsFunctions, ILoadOptionsFunctions,
} from 'n8n-core'; } from 'n8n-core';
import { IDataObject, NodeApiError } from 'n8n-workflow'; import { IDataObject } from 'n8n-workflow';
export async function sendGridApiRequest( export async function sendGridApiRequest(
this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,

View file

@ -7,7 +7,7 @@ import {
ILoadOptionsFunctions, ILoadOptionsFunctions,
} from 'n8n-core'; } from 'n8n-core';
import { IDataObject, IOAuth2Options, NodeApiError } from 'n8n-workflow'; import { IDataObject, IOAuth2Options } from 'n8n-workflow';
import { snakeCase } from 'change-case'; import { snakeCase } from 'change-case';

View file

@ -1,7 +1,5 @@
import { IExecuteFunctions, IHookFunctions } from 'n8n-core'; import { IExecuteFunctions, IHookFunctions } from 'n8n-core';
import { NodeApiError } from 'n8n-workflow';
import { flow, isEmpty, omit } from 'lodash'; import { flow, isEmpty, omit } from 'lodash';
import { IDataObject, ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow'; import { IDataObject, ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';

View file

@ -2,7 +2,7 @@ import { OptionsWithUri } from 'request';
import { IExecuteFunctions, IHookFunctions, ILoadOptionsFunctions } from 'n8n-core'; import { IExecuteFunctions, IHookFunctions, ILoadOptionsFunctions } from 'n8n-core';
import { IDataObject, jsonParse, NodeApiError } from 'n8n-workflow'; import { IDataObject, jsonParse } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment';
import { Eq } from './QueryFunctions'; import { Eq } from './QueryFunctions';

View file

@ -2,7 +2,7 @@ import { IExecuteFunctions, IHookFunctions, ILoadOptionsFunctions } from 'n8n-co
import { OptionsWithUri } from 'request'; import { OptionsWithUri } from 'request';
import { IDataObject, JsonObject, NodeApiError } from 'n8n-workflow'; import { IDataObject } from 'n8n-workflow';
/** /**
* Make an API request to Trello * Make an API request to Trello

View file

@ -1,5 +1,4 @@
import { IExecuteFunctions, IHookFunctions, ILoadOptionsFunctions } from 'n8n-core'; import { IExecuteFunctions, IHookFunctions, ILoadOptionsFunctions } from 'n8n-core';
import { NodeApiError } from 'n8n-workflow';
import { OptionsWithUri } from 'request'; import { OptionsWithUri } from 'request';

View file

@ -1,6 +1,6 @@
import { IExecuteFunctions, IHookFunctions } from 'n8n-core'; import { IExecuteFunctions, IHookFunctions } from 'n8n-core';
import { IDataObject, NodeApiError } from 'n8n-workflow'; import { IDataObject } from 'n8n-workflow';
import { OptionsWithUri } from 'request'; import { OptionsWithUri } from 'request';

View file

@ -2,7 +2,7 @@ import { OptionsWithUri } from 'request';
import { IExecuteFunctions } from 'n8n-core'; import { IExecuteFunctions } from 'n8n-core';
import { IDataObject, NodeApiError } from 'n8n-workflow'; import { IDataObject } from 'n8n-workflow';
export async function urlScanIoApiRequest( export async function urlScanIoApiRequest(
this: IExecuteFunctions, this: IExecuteFunctions,

View file

@ -7,7 +7,7 @@ import {
IWebhookFunctions, IWebhookFunctions,
} from 'n8n-core'; } from 'n8n-core';
import { IDataObject, NodeApiError } from 'n8n-workflow'; import { IDataObject } from 'n8n-workflow';
export async function webflowApiRequest( export async function webflowApiRequest(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions,

View file

@ -2,7 +2,7 @@ import { IExecuteFunctions, IHookFunctions, ILoadOptionsFunctions } from 'n8n-co
import { OptionsWithUri } from 'request'; import { OptionsWithUri } from 'request';
import { IDataObject, JsonObject, NodeApiError, NodeOperationError } from 'n8n-workflow'; import { IDataObject } from 'n8n-workflow';
export async function apiRequest( export async function apiRequest(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,

View file

@ -8,7 +8,7 @@ import {
IWebhookFunctions, IWebhookFunctions,
} from 'n8n-core'; } from 'n8n-core';
import { ICredentialDataDecryptedObject, IDataObject, NodeApiError } from 'n8n-workflow'; import { ICredentialDataDecryptedObject, IDataObject } from 'n8n-workflow';
import { ICouponLine, IFeeLine, ILineItem, IShoppingLine } from './OrderInterface'; import { ICouponLine, IFeeLine, ILineItem, IShoppingLine } from './OrderInterface';

View file

@ -7,7 +7,7 @@ import {
ILoadOptionsFunctions, ILoadOptionsFunctions,
} from 'n8n-core'; } from 'n8n-core';
import { IDataObject, JsonObject, NodeApiError } from 'n8n-workflow'; import { IDataObject } from 'n8n-workflow';
export async function wufooApiRequest( export async function wufooApiRequest(
this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,

View file

@ -7,7 +7,7 @@ import {
ILoadOptionsFunctions, ILoadOptionsFunctions,
} from 'n8n-core'; } from 'n8n-core';
import { IDataObject, JsonObject, NodeApiError } from 'n8n-workflow'; import { IDataObject } from 'n8n-workflow';
export async function zendeskApiRequest( export async function zendeskApiRequest(
this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,