mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor: Run lintfix (no-changelog) (#7537)
- Fix autofixable violations - Remove unused directives - Allow for PascalCased variables - needed for dynamically imported or assigned classes, decorators, routers, etc.
This commit is contained in:
@@ -23,7 +23,7 @@ export const initErrorHandling = async () => {
|
||||
const { N8N_VERSION: release, ENVIRONMENT: environment } = process.env;
|
||||
|
||||
const { init, captureException, addGlobalEventProcessor } = await import('@sentry/node');
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
|
||||
const { RewriteFrames } = await import('@sentry/integrations');
|
||||
|
||||
init({
|
||||
|
||||
@@ -316,7 +316,7 @@ export class LoadNodesAndCredentials {
|
||||
const { default: debounce } = await import('lodash/debounce');
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
const { watch } = await import('chokidar');
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
|
||||
const { Push } = await import('@/push');
|
||||
const push = Container.get(Push);
|
||||
|
||||
|
||||
@@ -43,9 +43,9 @@ export class Queue {
|
||||
const prefix = getRedisPrefix(bullPrefix);
|
||||
const clusterNodes = getRedisClusterNodes();
|
||||
const usesRedisCluster = clusterNodes.length > 0;
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
|
||||
const { default: Bull } = await import('bull');
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
|
||||
const { default: Redis } = await import('ioredis');
|
||||
// Disabling ready check is necessary as it allows worker to
|
||||
// quickly reconnect to Redis if Redis crashes or is unreachable
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */
|
||||
/* eslint-disable prefer-const */
|
||||
/* eslint-disable @typescript-eslint/no-shadow */
|
||||
@@ -335,7 +335,6 @@ export class Server extends AbstractServer {
|
||||
}
|
||||
|
||||
if (config.getEnv('nodes.communityPackages.enabled')) {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
const { CommunityPackagesController } = await import(
|
||||
'@/controllers/communityPackages.controller'
|
||||
);
|
||||
@@ -343,7 +342,6 @@ export class Server extends AbstractServer {
|
||||
}
|
||||
|
||||
if (inE2ETests) {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
const { E2EController } = await import('./controllers/e2e.controller');
|
||||
controllers.push(Container.get(E2EController));
|
||||
}
|
||||
@@ -357,7 +355,6 @@ export class Server extends AbstractServer {
|
||||
|
||||
async configure(): Promise<void> {
|
||||
if (config.getEnv('endpoints.metrics.enable')) {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
const { MetricsService } = await import('@/services/metrics.service');
|
||||
await Container.get(MetricsService).configureMetrics(this.app);
|
||||
}
|
||||
|
||||
@@ -964,7 +964,7 @@ async function executeWorkflow(
|
||||
activeExecutions.remove(executionId, data);
|
||||
// Workflow did fail
|
||||
const { error } = data.data.resultData;
|
||||
// eslint-disable-next-line @typescript-eslint/no-throw-literal
|
||||
|
||||
throw objectToError(
|
||||
{
|
||||
...error,
|
||||
|
||||
@@ -37,7 +37,7 @@ import type {
|
||||
} from '@/Interfaces';
|
||||
import { NodeTypes } from '@/NodeTypes';
|
||||
import type { Job, JobData, JobResponse } from '@/Queue';
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
|
||||
import { Queue } from '@/Queue';
|
||||
import { decodeWebhookResponse } from '@/helpers/decodeWebhookResponse';
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
|
||||
@@ -178,7 +178,7 @@ class WorkflowRunnerProcess {
|
||||
additionalData.setExecutionStatus = WorkflowExecuteAdditionalData.setExecutionStatus.bind({
|
||||
executionId: inputData.executionId,
|
||||
});
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
||||
additionalData.sendDataToUI = async (type: string, data: IDataObject | IDataObject[]) => {
|
||||
if (workflowRunner.data!.executionMode !== 'manual') {
|
||||
return;
|
||||
|
||||
@@ -17,7 +17,6 @@ import type { Risk } from '@/audit/types';
|
||||
async function getCommunityNodeDetails() {
|
||||
if (!config.getEnv('nodes.communityPackages.enabled')) return [];
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
const { CommunityPackagesService } = await import('@/services/communityPackages.service');
|
||||
const installedPackages = await Container.get(CommunityPackagesService).getAllInstalledPackages();
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ export class Reset extends BaseCommand {
|
||||
static description = '\nResets the database to the default ldap state';
|
||||
|
||||
async run(): Promise<void> {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
const { AuthIdentity, AuthProviderSyncHistory, Settings, User } = Db.collections;
|
||||
const ldapIdentities = await AuthIdentity.find({
|
||||
where: { providerType: 'ldap' },
|
||||
|
||||
@@ -248,7 +248,6 @@ export class Start extends BaseCommand {
|
||||
const areCommunityPackagesEnabled = config.getEnv('nodes.communityPackages.enabled');
|
||||
|
||||
if (areCommunityPackagesEnabled) {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
const { CommunityPackagesService } = await import('@/services/communityPackages.service');
|
||||
await Container.get(CommunityPackagesService).setMissingPackages({
|
||||
reinstallMissingPackages: flags.reinstallMissingPackages,
|
||||
|
||||
@@ -12,7 +12,6 @@ import { Container } from 'typedi';
|
||||
import { InternalHooks } from '@/InternalHooks';
|
||||
import type { CredentialsEntity } from '@/databases/entities/CredentialsEntity';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
export const EECredentialsController = express.Router();
|
||||
|
||||
EECredentialsController.use((req, res, next) => {
|
||||
|
||||
@@ -61,7 +61,7 @@ function mixinTimestamps<T extends Constructor<{}>>(base: T) {
|
||||
}
|
||||
|
||||
class BaseEntity {}
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
export const WithStringId = mixinStringId(BaseEntity);
|
||||
export const WithTimestamps = mixinTimestamps(BaseEntity);
|
||||
export const WithTimestampsAndStringId = mixinStringId(WithTimestamps);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { CONTROLLER_MIDDLEWARES } from './constants';
|
||||
import type { MiddlewareMetadata } from './types';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
export const Middleware = (): MethodDecorator => (target, handlerName) => {
|
||||
const controllerClass = target.constructor;
|
||||
const middlewares = (Reflect.getMetadata(CONTROLLER_MIDDLEWARES, controllerClass) ??
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { CONTROLLER_BASE_PATH } from './constants';
|
||||
|
||||
export const RestController =
|
||||
|
||||
@@ -6,7 +6,6 @@ interface RouteOptions {
|
||||
middlewares?: RequestHandler[];
|
||||
}
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
const RouteFactory =
|
||||
(method: Method) =>
|
||||
(path: `/${string}`, options: RouteOptions = {}): MethodDecorator =>
|
||||
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
import { isVariablesEnabled } from './enviromentHelpers';
|
||||
import { Logger } from '@/Logger';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
export const EEVariablesController = express.Router();
|
||||
|
||||
EEVariablesController.use((req, res, next) => {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import express from 'express';
|
||||
import { isEventMessageOptions } from './EventMessageClasses/AbstractEventMessage';
|
||||
import { EventMessageGeneric } from './EventMessageClasses/EventMessageGeneric';
|
||||
|
||||
@@ -9,7 +9,6 @@ import * as ResponseHelper from '@/ResponseHelper';
|
||||
import { isSharingEnabled } from '@/UserManagement/UserManagementHelper';
|
||||
import { EEExecutionsService } from './executions.service.ee';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
export const EEExecutionsController = express.Router();
|
||||
|
||||
EEExecutionsController.use((req, res, next) => {
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
import * as ResponseHelper from '@/ResponseHelper';
|
||||
import { WorkflowFilter } from './dtos/workflow.filter.dto';
|
||||
import { CredentialsFilter } from './dtos/credentials.filter.dto';
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
import { WorkflowSelect } from './dtos/workflow.select.dto';
|
||||
import { UserSelect } from './dtos/user.select.dto';
|
||||
import { CredentialsSelect } from './dtos/credentials.select.dto';
|
||||
|
||||
@@ -17,7 +17,6 @@ export class PostHogClient {
|
||||
return;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
const { PostHog } = await import('posthog-node');
|
||||
this.postHog = new PostHog(config.getEnv('diagnostics.config.posthog.apiKey'), {
|
||||
host: config.getEnv('diagnostics.config.posthog.apiHost'),
|
||||
|
||||
@@ -143,7 +143,6 @@ export async function getDefaultRedisClient(
|
||||
additionalRedisOptions?: RedisOptions,
|
||||
redisType?: RedisClientType,
|
||||
): Promise<Redis | Cluster> {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
const { default: Redis } = await import('ioredis');
|
||||
const clusterNodes = getRedisClusterNodes();
|
||||
const usesRedisCluster = clusterNodes.length > 0;
|
||||
|
||||
@@ -56,7 +56,6 @@ export class Telemetry {
|
||||
|
||||
const logLevel = config.getEnv('logs.level');
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
const { default: RudderStack } = await import('@rudderstack/rudder-sdk-node');
|
||||
this.rudderStack = new RudderStack(key, url, { logLevel });
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ import { TagService } from '@/services/tag.service';
|
||||
import { Logger } from '@/Logger';
|
||||
import { WorkflowHistoryService } from './workflowHistory/workflowHistory.service.ee';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
export const EEWorkflowController = express.Router();
|
||||
|
||||
EEWorkflowController.use((req, res, next) => {
|
||||
|
||||
@@ -506,7 +506,6 @@ export class WorkflowsService {
|
||||
if (isWorkflowIdValid(workflow.id)) {
|
||||
// Workflow is saved so update in database
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
||||
await WorkflowsService.saveStaticDataById(workflow.id, workflow.staticData);
|
||||
workflow.staticData.__dataChanged = false;
|
||||
} catch (error) {
|
||||
|
||||
@@ -8,7 +8,6 @@ import type { User } from '@db/entities/User';
|
||||
import type { BooleanLicenseFeature, ICredentialsDb, IDatabaseCollections } from '@/Interfaces';
|
||||
import type { DataSource, Repository } from 'typeorm';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export type CollectionName =
|
||||
| keyof IDatabaseCollections
|
||||
| { new (dataSource: DataSource): Repository<any> };
|
||||
|
||||
Reference in New Issue
Block a user