Skip to content

Commit

Permalink
refactor: Remove unused lint directives (no-changelog) (#9842)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivov authored Jun 24, 2024
1 parent 16d3083 commit 44ea4c7
Show file tree
Hide file tree
Showing 92 changed files with 85 additions and 138 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/13-pinning.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ describe('Data pinning', () => {
ndv.actions.close();

workflowPage.actions.addNodeToCanvas(EDIT_FIELDS_SET_NODE_NAME, true, true);
// eslint-disable-next-line @typescript-eslint/no-use-before-define

setExpressionOnStringValueInSet(`{{ $('${HTTP_REQUEST_NODE_NAME}').item`);

const output = '[Object: {"json": {"http": 123}, "pairedItem": {"item": 0}}]';
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/14-data-transformation-expressions.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-use-before-define */
import { WorkflowPage, NDV } from '../pages';

const wf = new WorkflowPage();
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/20-workflow-executions.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe('Current Workflow Executions', () => {
.should('be.visible')
.its('0.contentDocument.body') // Access the body of the iframe document
.should('not.be.empty') // Ensure the body is not empty
// eslint-disable-next-line @typescript-eslint/unbound-method

.then(cy.wrap)
.find('.el-notification:has(.el-notification--error)')
.should('be.visible')
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/2106-ADO-pinned-data-execution-preview.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('ADO-2106 connections should be colored correctly for pinned data in ex
.should('be.visible')
.its('0.contentDocument.body')
.should('not.be.empty')
// eslint-disable-next-line @typescript-eslint/unbound-method

.then(cy.wrap)
.find('.jtk-connector[data-source-node="Webhook"][data-target-node="Set"]')
.should('have.class', 'success')
Expand All @@ -56,7 +56,7 @@ describe('ADO-2106 connections should be colored correctly for pinned data in ex
.should('be.visible')
.its('0.contentDocument.body')
.should('not.be.empty')
// eslint-disable-next-line @typescript-eslint/unbound-method

.then(cy.wrap)
.find('.jtk-connector[data-source-node="Webhook"][data-target-node="Set"]')
.should('have.class', 'success')
Expand Down
1 change: 0 additions & 1 deletion packages/@n8n/client-oauth2/src/ClientOAuth2Token.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import type { ClientOAuth2, ClientOAuth2Options, ClientOAuth2RequestObject } from './ClientOAuth2';
import { auth, expects, getRequestOptions } from './utils';
import { DEFAULT_HEADERS } from './constants';
Expand Down
1 change: 0 additions & 1 deletion packages/@n8n/client-oauth2/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import type { Headers } from './types';

export const DEFAULT_URL_BASE = 'https://example.org/';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type {
} from 'n8n-workflow';
import { NodeConnectionType, NodeOperationError, tryToParseAlphanumericString } from 'n8n-workflow';

import { DynamicTool } from '@langchain/core/tools';
import { getConnectionHintNoticeField } from '../../../utils/sharedFields';

import {
Expand All @@ -31,8 +32,6 @@ import {

import type { PlaceholderDefinition, ToolParameter } from './interfaces';

import { DynamicTool } from '@langchain/core/tools';

export class ToolHttpRequest implements INodeType {
description: INodeTypeDescription = {
displayName: 'HTTP Request Tool',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@ import { NodeConnectionType, NodeOperationError, jsonParse } from 'n8n-workflow'

import { getOAuth2AdditionalParameters } from 'n8n-nodes-base/dist/nodes/HttpRequest/GenericFunctions';

import type {
ParameterInputType,
ParametersValues,
PlaceholderDefinition,
ParametersValues as RawParametersValues,
SendIn,
ToolParameter,
} from './interfaces';

import set from 'lodash/set';
import get from 'lodash/get';
import unset from 'lodash/unset';
Expand All @@ -28,6 +19,14 @@ import { convert } from 'html-to-text';

import { Readability } from '@mozilla/readability';
import { JSDOM } from 'jsdom';
import type {
ParameterInputType,
ParametersValues,
PlaceholderDefinition,
ParametersValues as RawParametersValues,
SendIn,
ToolParameter,
} from './interfaces';

const genericCredentialRequest = async (ctx: IExecuteFunctions, itemIndex: number) => {
const genericType = ctx.getNodeParameter('genericAuthType', itemIndex) as string;
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/Db.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */
import { Container } from 'typedi';
// eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import
import type { EntityManager } from '@n8n/typeorm';
Expand Down
2 changes: 0 additions & 2 deletions packages/cli/src/ExternalHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@ export class ExternalHooks {
credentialsRepository: CredentialsRepository,
workflowRepository: WorkflowRepository,
) {
/* eslint-disable @typescript-eslint/naming-convention */
this.dbCollections = {
User: userRepository,
Settings: settingsRepository,
Credentials: credentialsRepository,
Workflow: workflowRepository,
};
/* eslint-enable @typescript-eslint/naming-convention */
}

async init(): Promise<void> {
Expand Down
2 changes: 0 additions & 2 deletions packages/cli/src/Interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,10 @@ export interface IExternalHooksFileData {

export interface IExternalHooksFunctions {
dbCollections: {
/* eslint-disable @typescript-eslint/naming-convention */
User: UserRepository;
Settings: SettingsRepository;
Credentials: CredentialsRepository;
Workflow: WorkflowRepository;
/* eslint-enable @typescript-eslint/naming-convention */
};
}

Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/Ldap/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-use-before-define */
import type { Entry as LdapUser } from 'ldapts';
import { Filter } from 'ldapts/filters/Filter';
import { Container } from 'typedi';
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/PublicApi/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { Container } from 'typedi';
import type { Router } from 'express';
import express from 'express';
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/WebhookHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ export function encodeWebhookResponse(
): IExecuteResponsePromiseData {
if (typeof response === 'object' && Buffer.isBuffer(response.body)) {
response.body = {
// eslint-disable-next-line @typescript-eslint/naming-convention
'__@N8nEncodedBuffer@__': response.body.toString(BINARY_ENCODING),
};
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/WorkflowExecuteAdditionalData.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/no-use-before-define */
/* eslint-disable id-denylist */

/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { WorkflowExecute } from 'n8n-core';
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/WorkflowHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export async function replaceInvalidCredentials(workflow: WorkflowEntity): Promi
credentialsById[nodeCredentialType][nodeCredentials.id];
}
}
/* eslint-enable no-await-in-loop */

return workflow;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/audit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class SecurityAudit extends BaseCommand {
default: RISK_CATEGORIES.join(','),
description: 'Comma-separated list of categories to include in the audit',
}),
// eslint-disable-next-line @typescript-eslint/naming-convention

'days-abandoned-workflow': Flags.integer({
default: config.getEnv('security.audit.daysAbandonedWorkflow'),
description: 'Days for a workflow to be considered abandoned if not executed',
Expand Down
2 changes: 0 additions & 2 deletions packages/cli/src/config/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */

import type { BinaryData } from 'n8n-core';
import type { schema } from './schema';
import type { RedisOptions } from 'ioredis';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ interface OAuth1CredentialData {
}

const algorithmMap = {
/* eslint-disable @typescript-eslint/naming-convention */
'HMAC-SHA256': 'sha256',
'HMAC-SHA512': 'sha512',
'HMAC-SHA1': 'sha1',
/* eslint-enable */
} as const;

@RestController('/oauth1-credential')
Expand Down Expand Up @@ -52,7 +50,7 @@ export class OAuth1CredentialController extends AbstractOAuthController {
secret: oauthCredentials.consumerSecret,
},
signature_method: signatureMethod,
// eslint-disable-next-line @typescript-eslint/naming-convention

hash_function(base, key) {
const algorithm = algorithmMap[signatureMethod] ?? 'sha1';
return createHmac(algorithm, key).update(base).digest('base64');
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/databases/entities/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { AuthIdentity } from './AuthIdentity';
import { AuthProviderSyncHistory } from './AuthProviderSyncHistory';
import { AuthUser } from './AuthUser';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class MigrateIntegerKeysToString1690000000001 implements IrreversibleMigr
if (databaseType === 'mariadb') {
collation = COLLATION_57;
} else {
const dbVersionQuery = (await queryRunner.query('SELECT @@version')) as // eslint-disable-next-line @typescript-eslint/naming-convention
const dbVersionQuery = (await queryRunner.query('SELECT @@version')) as
| Array<{ '@@version': string }>
| undefined;
collation = COLLATION_80;
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/databases/utils/customValidators.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { registerDecorator } from 'class-validator';

export function NoXss() {
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/decorators/OnShutdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { type ServiceClass, ShutdownService } from '@/shutdown/Shutdown.service'
export const OnShutdown =
(priority = 100): MethodDecorator =>
(prototype, propertyKey, descriptor) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const serviceClass = prototype.constructor as ServiceClass;
const methodName = String(propertyKey);
// TODO: assert that serviceClass is decorated with @Service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ export class SourceControlGitService {
await this.setGitSshCommand();
const params = {};
if (options.ffOnly) {
// eslint-disable-next-line @typescript-eslint/naming-convention
Object.assign(params, { '--ff-only': true });
}
return await this.git.pull(params);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */

import { MessageEventBusDestination } from './MessageEventBusDestination.ee';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */

import { isObjectLiteral } from '@/utils';
import { plainToInstance, instanceToPlain } from 'class-transformer';
import { validate } from 'class-validator';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */

import { isStringArray } from '@/utils';
import { ApplicationError, jsonParse } from 'n8n-workflow';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ export class InstanceRiskReporter implements RiskReporter {
const { instanceId } = this.instanceSettings;

const response = await axios.get<n8n.Version[]>(BASE_URL + currentVersionName, {
// eslint-disable-next-line @typescript-eslint/naming-convention
headers: { 'n8n-instance-id': instanceId },
});

Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/services/frontend.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export class FrontendService {
this.initSettings();

if (config.getEnv('nodes.communityPackages.enabled')) {
// eslint-disable-next-line @typescript-eslint/naming-convention
void import('@/services/communityPackages.service').then(({ CommunityPackagesService }) => {
this.communityPackagesService = Container.get(CommunityPackagesService);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ export function getWorkerCommandReceivedHandler(options: WorkerCommandReceivedHa
}

logger.debug(
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
`Received unknown command via channel ${COMMAND_REDIS_CHANNEL}: "${message.command}"`,
);
break;
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/services/redis/RedisServiceBaseClasses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class RedisServiceBase {

this.redisClient.on('error', (error) => {
if (!String(error).includes('ECONNREFUSED')) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
this.logger.warn('Error with Redis: ', error);
}
});
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/sso/saml/serviceProvider.ee.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { Container } from 'typedi';
import type { ServiceProviderInstance } from 'samlify';
import { UrlService } from '@/services/url.service';
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/sso/saml/types/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export declare namespace SamlConfiguration {
{},
{},
{
// eslint-disable-next-line @typescript-eslint/naming-convention
RelayState?: string;
},
{}
Expand Down
1 change: 0 additions & 1 deletion packages/cli/test/integration/commands/reset.cmd.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ beforeEach(async () => {
await testDb.truncate(['User']);
});

// eslint-disable-next-line n8n-local-rules/no-skipped-tests
test('user-management:reset should reset DB to default user state', async () => {
//
// ARRANGE
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/NodeExecuteFunctions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
/* eslint-disable @typescript-eslint/naming-convention */

/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-return */
Expand Down Expand Up @@ -454,7 +454,6 @@ export async function parseRequestObject(requestObject: IRequestOptions) {
// Check support for sendImmediately
if (requestObject.auth.bearer !== undefined) {
axiosConfig.headers = Object.assign(axiosConfig.headers || {}, {
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
Authorization: `Bearer ${requestObject.auth.bearer}`,
});
} else {
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/ObjectStore/ObjectStore.service.ee.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */

import { createHash } from 'node:crypto';
import axios from 'axios';
import { Service } from 'typedi';
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/WorkflowExecute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1087,9 +1087,8 @@ export class WorkflowExecute {
}

if (nodeSuccessData instanceof NodeExecutionOutput) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
const hints: NodeExecutionHint[] = nodeSuccessData.getHints();
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument

executionHints.push(...hints);
}

Expand Down
2 changes: 2 additions & 0 deletions packages/editor-ui/src/__tests__/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ Range.prototype.getClientRects = vi.fn(() => ({

export class IntersectionObserver {
root = null;

rootMargin = '';

thresholds = [];

disconnect() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
:message="$locale.baseText('credentialEdit.credentialConfig.accountConnected')"
:button-label="$locale.baseText('credentialEdit.credentialConfig.reconnect')"
:button-title="$locale.baseText('credentialEdit.credentialConfig.reconnectOAuth2Credential')"
@click="$emit('oauth')"
data-test-id="oauth-connect-success-banner"
@click="$emit('oauth')"
>
<template v-if="isGoogleOAuthType" #button>
<p
Expand Down Expand Up @@ -118,8 +118,8 @@
isOAuthType && requiredPropertiesFilled && !isOAuthConnected && credentialPermissions.update
"
:is-google-o-auth-type="isGoogleOAuthType"
@click="$emit('oauth')"
data-test-id="oauth-connect-button"
@click="$emit('oauth')"
/>

<n8n-text v-if="isMissingCredentials" color="text-base" size="medium">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ export default defineComponent({
};
}
this.credentialName = currentCredentials.name as string;
this.credentialName = currentCredentials.name;
} catch (error) {
this.showError(
error,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async function onUpdateConnected(value: boolean) {
if (props.beforeUpdate) {
const result = await props.beforeUpdate(value);
if (result === false) {
if (!result) {
saving.value = false;
return;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/editor-ui/src/components/NpsSurvey.vue
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ watch(
</div>
</div>
<div v-else :class="$style.email">
<div :class="$style.input" @keyup.enter="send" data-test-id="nps-survey-email">
<div :class="$style.input" data-test-id="nps-survey-email" @keyup.enter="send">
<n8n-input
v-model="form.email"
:placeholder="YOUR_EMAIL_ADDRESS"
Expand Down
Loading

0 comments on commit 44ea4c7

Please sign in to comment.