refactor: Remove unused lint directives (no-changelog) (#9842)

This commit is contained in:
Iván Ovejero
2024-06-24 12:13:18 +02:00
committed by GitHub
parent 16d3083af7
commit 44ea4c73eb
92 changed files with 85 additions and 138 deletions

View File

@@ -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';

View File

@@ -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> {

View File

@@ -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 */
};
}

View File

@@ -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';

View File

@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { Container } from 'typedi';
import type { Router } from 'express';
import express from 'express';

View File

@@ -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),
};
}

View File

@@ -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';

View File

@@ -219,7 +219,7 @@ export async function replaceInvalidCredentials(workflow: WorkflowEntity): Promi
credentialsById[nodeCredentialType][nodeCredentials.id];
}
}
/* eslint-enable no-await-in-loop */
return workflow;
}

View File

@@ -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',

View File

@@ -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';

View File

@@ -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')
@@ -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');

View File

@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { AuthIdentity } from './AuthIdentity';
import { AuthProviderSyncHistory } from './AuthProviderSyncHistory';
import { AuthUser } from './AuthUser';

View File

@@ -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;

View File

@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { registerDecorator } from 'class-validator';
export function NoXss() {

View File

@@ -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

View File

@@ -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);

View File

@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { MessageEventBusDestination } from './MessageEventBusDestination.ee';

View File

@@ -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';

View File

@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { isStringArray } from '@/utils';
import { ApplicationError, jsonParse } from 'n8n-workflow';

View File

@@ -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 },
});

View File

@@ -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);
});

View File

@@ -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;

View File

@@ -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);
}
});

View File

@@ -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';

View File

@@ -9,7 +9,6 @@ export declare namespace SamlConfiguration {
{},
{},
{
// eslint-disable-next-line @typescript-eslint/naming-convention
RelayState?: string;
},
{}

View File

@@ -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