Eslint migration 4 (#13773)

A new attempt to migrate!
This commit is contained in:
Félix Malfait
2025-08-08 16:21:57 +02:00
committed by GitHub
parent 81012ab1fb
commit 5fae14377a
36 changed files with 1206 additions and 510 deletions
@@ -32,7 +32,7 @@ export function WorkspaceQueryHook(
options.type = WorkspaceQueryHookType.PRE_HOOK;
}
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
return (target: Function) => {
SetMetadata(SCOPE_OPTIONS_METADATA, options)(target);
SetMetadata(WORKSPACE_QUERY_HOOK_METADATA, options)(target);
@@ -1,9 +1,9 @@
/* eslint-disable @typescript-eslint/ban-types */
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
import { Injectable, type Type } from '@nestjs/common';
import { Reflector } from '@nestjs/core';
import { WORKSPACE_QUERY_HOOK_METADATA } from 'src/engine/api/graphql/workspace-query-runner/workspace-query-hook/workspace-query-hook.constants';
import { type WorkspaceQueryHookOptions } from 'src/engine/api/graphql/workspace-query-runner/workspace-query-hook/decorators/workspace-query-hook.decorator';
import { WORKSPACE_QUERY_HOOK_METADATA } from 'src/engine/api/graphql/workspace-query-runner/workspace-query-hook/workspace-query-hook.constants';
@Injectable()
export class WorkspaceQueryHookMetadataAccessor {
@@ -37,7 +37,7 @@ export function Processor(
? queueNameOrOptions
: { queueName: queueNameOrOptions };
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
return (target: Function) => {
SetMetadata(SCOPE_OPTIONS_METADATA, options)(target);
SetMetadata(PROCESSOR_METADATA, options)(target);
@@ -1,4 +1,4 @@
/* eslint-disable @typescript-eslint/ban-types */
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
import { Injectable, type Type } from '@nestjs/common';
import { Reflector } from '@nestjs/core';
@@ -243,7 +243,7 @@ describe('WorkspaceService', () => {
await service.deleteWorkspace(mockWorkspace.id, true);
expect(billingSubscriptionService.deleteSubscriptions).toHaveBeenCalled;
expect(billingSubscriptionService.deleteSubscriptions).toHaveBeenCalled();
expect(workspaceRepository.softDelete).toHaveBeenCalledWith({
id: mockWorkspace.id,
@@ -250,7 +250,7 @@ export class FieldMetadataServiceV2 {
flatFieldMetadata: flatFieldMetadataToCreate,
flatObjectMetadataMaps: optimisticFlatObjectMetadataMaps,
});
} catch (e) {
} catch {
throw new FieldMetadataException(
'Optimistic cache manipulation failed, should never occur',
FieldMetadataExceptionCode.INTERNAL_SERVER_ERROR,
@@ -9,7 +9,7 @@ export const addFlatFieldMetadataInFlatObjectMetadataMaps = (
): FlatObjectMetadataMaps | undefined => {
try {
return addFlatFieldMetadataInFlatObjectMetadataMapsOrThrow(arg);
} catch (e) {
} catch {
return undefined;
}
};
@@ -1,7 +1,8 @@
import { type FactoryProvider, type ModuleMetadata } from '@nestjs/common';
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface TwentyORMOptions {}
export interface TwentyORMOptions {
[key: string]: unknown;
}
export type TwentyORMModuleAsyncOptions = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -44,7 +44,7 @@ export interface WorkspaceDynamicRelationMetadataArgs {
/**
* Class to which relation is applied.
*/
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
readonly target: Function;
/**
@@ -13,7 +13,7 @@ export interface WorkspaceEntityMetadataArgs {
* Function target is a table defined in the class.
* String target is a table defined in a json schema.
*/
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
readonly target: Function;
/**
@@ -6,7 +6,7 @@ export interface WorkspaceExtendedEntityMetadataArgs {
* Function target is a table defined in the class.
* String target is a table defined in a json schema.
*/
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
readonly target: Function;
/**
@@ -16,7 +16,7 @@ export interface WorkspaceFieldMetadataArgs {
/**
* Class to which field is applied.
*/
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
readonly target: Function;
/**
@@ -6,7 +6,7 @@ export interface WorkspaceIndexMetadataArgs {
/**
* Class to which index is applied.
*/
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
readonly target: Function;
/*
@@ -2,7 +2,7 @@ export interface WorkspaceJoinColumnsMetadataArgs {
/**
* Class to which relation is applied.
*/
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
readonly target: Function;
/**
@@ -15,7 +15,7 @@ export interface WorkspaceRelationMetadataArgs {
/**
* Class to which relation is applied.
*/
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
readonly target: Function;
/**
@@ -1,4 +1,4 @@
/* eslint-disable @typescript-eslint/ban-types */
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
import { type WorkspaceDynamicRelationMetadataArgs } from 'src/engine/twenty-orm/interfaces/workspace-dynamic-relation-metadata-args.interface';
import { type WorkspaceEntityMetadataArgs } from 'src/engine/twenty-orm/interfaces/workspace-entity-metadata-args.interface';
@@ -31,9 +31,7 @@ export const companiesAllView = (
fieldMetadataId:
companyObjectMetadata.fields.find(
(field) => field.standardId === COMPANY_STANDARD_FIELD_IDS.name,
)?.id ??
'' ??
'',
)?.id ?? '',
position: 0,
isVisible: true,
size: 180,
@@ -43,9 +41,7 @@ export const companiesAllView = (
companyObjectMetadata.fields.find(
(field) =>
field.standardId === COMPANY_STANDARD_FIELD_IDS.domainName,
)?.id ??
'' ??
'',
)?.id ?? '',
position: 1,
isVisible: true,
size: 100,