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
- name: Lint
env:
CI_LINT_MASTER: true
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
*
* Disabled because eslint-plugin-diff fails to catch it. TODO: Revisit.
*/
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
process.env.CI_LINT_MASTER ? 'warn' : 'error',
{
argsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -2,7 +2,7 @@ import { OptionsWithUri } from 'request';
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';

View file

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

View file

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

View file

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

View file

@ -1,6 +1,6 @@
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';

View file

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

View file

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

View file

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

View file

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

View file

@ -2,7 +2,7 @@ import { OptionsWithUri } from 'request';
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(
this: IExecuteFunctions | IExecuteSingleFunctions | IHookFunctions | ILoadOptionsFunctions,

View file

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

View file

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

View file

@ -1,13 +1,6 @@
import { IPollFunctions } from 'n8n-core';
import {
IDataObject,
ILoadOptionsFunctions,
INodeExecutionData,
INodePropertyOptions,
INodeType,
INodeTypeDescription,
} from 'n8n-workflow';
import { IDataObject, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
import { notionApiRequest, simplifyObjects } from './GenericFunctions';
@ -89,14 +82,15 @@ export class NotionTrigger implements INodeType {
type: 'regex',
properties: {
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',
},
},
],
extractValue: {
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',
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',
},
},
@ -125,7 +120,7 @@ export class NotionTrigger implements INodeType {
event: ['pageAddedToDatabase', 'pagedUpdatedInDatabase'],
},
},
description: "The Notion Database to operate on",
description: 'The Notion Database to operate on',
},
{
displayName: 'Simplify',

View file

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

View file

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

View file

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

View file

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

View file

@ -1,7 +1,5 @@
import { IExecuteFunctions, IHookFunctions } from 'n8n-core';
import { NodeApiError } from 'n8n-workflow';
import { flow, isEmpty, omit } from 'lodash';
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 { IDataObject, jsonParse, NodeApiError } from 'n8n-workflow';
import { IDataObject, jsonParse } from 'n8n-workflow';
import moment from 'moment';
import { Eq } from './QueryFunctions';

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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