lint: migrate prettier to oxfmt (#20783)
Most changes are `implements` being unwrapped this is not a oxfmt regression Prettier in 3.7 (we're on 3.1) changed this behaviour prettier blog [post](https://prettier.io/blog/2025/11/27/3.7.0#change-18094) This unifies our linting tooling --------- Co-authored-by: github-actions <github-actions@twenty.com> Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
+1
-3
@@ -16,9 +16,7 @@ import {
|
||||
import { type WorkspaceAuthContext } from 'src/engine/core-modules/auth/types/workspace-auth-context.type';
|
||||
|
||||
@WorkspaceQueryHook(`*.createMany`)
|
||||
export class CreatedByCreateManyPreQueryHook
|
||||
implements WorkspacePreQueryHookInstance
|
||||
{
|
||||
export class CreatedByCreateManyPreQueryHook implements WorkspacePreQueryHookInstance {
|
||||
constructor(
|
||||
private readonly actorFromAuthContextService: ActorFromAuthContextService,
|
||||
) {}
|
||||
|
||||
+1
-3
@@ -16,9 +16,7 @@ import {
|
||||
import { type WorkspaceAuthContext } from 'src/engine/core-modules/auth/types/workspace-auth-context.type';
|
||||
|
||||
@WorkspaceQueryHook(`*.createOne`)
|
||||
export class CreatedByCreateOnePreQueryHook
|
||||
implements WorkspacePreQueryHookInstance
|
||||
{
|
||||
export class CreatedByCreateOnePreQueryHook implements WorkspacePreQueryHookInstance {
|
||||
constructor(
|
||||
private readonly actorFromAuthContextService: ActorFromAuthContextService,
|
||||
) {}
|
||||
|
||||
+1
-3
@@ -16,9 +16,7 @@ import {
|
||||
import { type WorkspaceAuthContext } from 'src/engine/core-modules/auth/types/workspace-auth-context.type';
|
||||
|
||||
@WorkspaceQueryHook(`*.updateMany`)
|
||||
export class UpdatedByUpdateManyPreQueryHook
|
||||
implements WorkspacePreQueryHookInstance
|
||||
{
|
||||
export class UpdatedByUpdateManyPreQueryHook implements WorkspacePreQueryHookInstance {
|
||||
constructor(
|
||||
private readonly actorFromAuthContextService: ActorFromAuthContextService,
|
||||
) {}
|
||||
|
||||
+1
-3
@@ -16,9 +16,7 @@ import {
|
||||
import { type WorkspaceAuthContext } from 'src/engine/core-modules/auth/types/workspace-auth-context.type';
|
||||
|
||||
@WorkspaceQueryHook(`*.updateOne`)
|
||||
export class UpdatedByUpdateOnePreQueryHook
|
||||
implements WorkspacePreQueryHookInstance
|
||||
{
|
||||
export class UpdatedByUpdateOnePreQueryHook implements WorkspacePreQueryHookInstance {
|
||||
constructor(
|
||||
private readonly actorFromAuthContextService: ActorFromAuthContextService,
|
||||
) {}
|
||||
|
||||
+3
-3
@@ -5,9 +5,9 @@ import {
|
||||
|
||||
import { type AppTokenEntity } from 'src/engine/core-modules/app-token/app-token.entity';
|
||||
|
||||
export class BeforeCreateOneAppToken<T extends AppTokenEntity>
|
||||
implements BeforeCreateOneHook<T>
|
||||
{
|
||||
export class BeforeCreateOneAppToken<
|
||||
T extends AppTokenEntity,
|
||||
> implements BeforeCreateOneHook<T> {
|
||||
async run(
|
||||
instance: CreateOneInputType<T>,
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
|
||||
+1
-3
@@ -5,9 +5,7 @@ import { formatDateTimeForClickHouse } from 'src/database/clickHouse/clickHouse.
|
||||
import { type ApplicationLogEntry } from 'src/engine/core-modules/application-logs/interfaces/application-log-entry.interface';
|
||||
import { type ApplicationLogDriverInterface } from 'src/engine/core-modules/application-logs/interfaces/application-log-driver.interface';
|
||||
|
||||
export class ClickHouseApplicationLogDriver
|
||||
implements ApplicationLogDriverInterface
|
||||
{
|
||||
export class ClickHouseApplicationLogDriver implements ApplicationLogDriverInterface {
|
||||
private readonly logger = new Logger(ClickHouseApplicationLogDriver.name);
|
||||
|
||||
constructor(private readonly clickHouseService: ClickHouseService) {}
|
||||
|
||||
+1
-3
@@ -3,9 +3,7 @@ import { Logger } from '@nestjs/common';
|
||||
import { type ApplicationLogDriverInterface } from 'src/engine/core-modules/application-logs/interfaces/application-log-driver.interface';
|
||||
import { type ApplicationLogEntry } from 'src/engine/core-modules/application-logs/interfaces/application-log-entry.interface';
|
||||
|
||||
export class ConsoleApplicationLogDriver
|
||||
implements ApplicationLogDriverInterface
|
||||
{
|
||||
export class ConsoleApplicationLogDriver implements ApplicationLogDriverInterface {
|
||||
private readonly logger = new Logger(ConsoleApplicationLogDriver.name);
|
||||
|
||||
async writeLogs(entries: ApplicationLogEntry[]): Promise<void> {
|
||||
|
||||
+1
-3
@@ -1,8 +1,6 @@
|
||||
import { type ApplicationLogDriverInterface } from 'src/engine/core-modules/application-logs/interfaces/application-log-driver.interface';
|
||||
|
||||
export class DisabledApplicationLogDriver
|
||||
implements ApplicationLogDriverInterface
|
||||
{
|
||||
export class DisabledApplicationLogDriver implements ApplicationLogDriverInterface {
|
||||
async writeLogs(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
+1
-3
@@ -12,9 +12,7 @@ import {
|
||||
} from 'src/engine/core-modules/graphql/utils/graphql-errors.util';
|
||||
|
||||
@Catch(ApplicationVariableEntityException)
|
||||
export class ApplicationVariableEntityExceptionFilter
|
||||
implements ExceptionFilter
|
||||
{
|
||||
export class ApplicationVariableEntityExceptionFilter implements ExceptionFilter {
|
||||
catch(exception: ApplicationVariableEntityException) {
|
||||
switch (exception.code) {
|
||||
case ApplicationVariableEntityExceptionCode.APPLICATION_VARIABLE_NOT_FOUND:
|
||||
|
||||
+7
-14
@@ -128,8 +128,7 @@ describe('SignInUpService workspace-creation policy', () => {
|
||||
} = createSignInUpServiceForTests();
|
||||
|
||||
mockConfigurationValues.IS_MULTIWORKSPACE_ENABLED = true;
|
||||
mockConfigurationValues.IS_WORKSPACE_CREATION_LIMITED_TO_SERVER_ADMINS =
|
||||
false;
|
||||
mockConfigurationValues.IS_WORKSPACE_CREATION_LIMITED_TO_SERVER_ADMINS = false;
|
||||
mockWorkspaceRepository.count.mockResolvedValue(0);
|
||||
mockUserRepository.count.mockResolvedValue(0);
|
||||
jest
|
||||
@@ -157,8 +156,7 @@ describe('SignInUpService workspace-creation policy', () => {
|
||||
} = createSignInUpServiceForTests();
|
||||
|
||||
mockConfigurationValues.IS_MULTIWORKSPACE_ENABLED = true;
|
||||
mockConfigurationValues.IS_WORKSPACE_CREATION_LIMITED_TO_SERVER_ADMINS =
|
||||
true;
|
||||
mockConfigurationValues.IS_WORKSPACE_CREATION_LIMITED_TO_SERVER_ADMINS = true;
|
||||
mockWorkspaceRepository.count.mockResolvedValue(0);
|
||||
mockUserRepository.count.mockResolvedValue(0);
|
||||
jest
|
||||
@@ -186,8 +184,7 @@ describe('SignInUpService workspace-creation policy', () => {
|
||||
} = createSignInUpServiceForTests();
|
||||
|
||||
mockConfigurationValues.IS_MULTIWORKSPACE_ENABLED = true;
|
||||
mockConfigurationValues.IS_WORKSPACE_CREATION_LIMITED_TO_SERVER_ADMINS =
|
||||
false;
|
||||
mockConfigurationValues.IS_WORKSPACE_CREATION_LIMITED_TO_SERVER_ADMINS = false;
|
||||
mockWorkspaceRepository.count.mockResolvedValue(1);
|
||||
mockUserRepository.count.mockResolvedValue(1);
|
||||
jest
|
||||
@@ -215,8 +212,7 @@ describe('SignInUpService workspace-creation policy', () => {
|
||||
} = createSignInUpServiceForTests();
|
||||
|
||||
mockConfigurationValues.IS_MULTIWORKSPACE_ENABLED = true;
|
||||
mockConfigurationValues.IS_WORKSPACE_CREATION_LIMITED_TO_SERVER_ADMINS =
|
||||
false;
|
||||
mockConfigurationValues.IS_WORKSPACE_CREATION_LIMITED_TO_SERVER_ADMINS = false;
|
||||
mockWorkspaceRepository.count.mockResolvedValue(0);
|
||||
mockUserRepository.count.mockResolvedValue(1);
|
||||
jest
|
||||
@@ -240,8 +236,7 @@ describe('SignInUpService workspace-creation policy', () => {
|
||||
createSignInUpServiceForTests();
|
||||
|
||||
mockConfigurationValues.IS_MULTIWORKSPACE_ENABLED = true;
|
||||
mockConfigurationValues.IS_WORKSPACE_CREATION_LIMITED_TO_SERVER_ADMINS =
|
||||
true;
|
||||
mockConfigurationValues.IS_WORKSPACE_CREATION_LIMITED_TO_SERVER_ADMINS = true;
|
||||
mockWorkspaceRepository.count.mockResolvedValue(1);
|
||||
|
||||
const nonAdminExistingUser = {
|
||||
@@ -265,8 +260,7 @@ describe('SignInUpService workspace-creation policy', () => {
|
||||
createSignInUpServiceForTests();
|
||||
|
||||
mockConfigurationValues.IS_MULTIWORKSPACE_ENABLED = false;
|
||||
mockConfigurationValues.IS_WORKSPACE_CREATION_LIMITED_TO_SERVER_ADMINS =
|
||||
false;
|
||||
mockConfigurationValues.IS_WORKSPACE_CREATION_LIMITED_TO_SERVER_ADMINS = false;
|
||||
mockWorkspaceRepository.count.mockResolvedValue(1);
|
||||
|
||||
await expect(
|
||||
@@ -288,8 +282,7 @@ describe('SignInUpService workspace-creation policy', () => {
|
||||
createSignInUpServiceForTests();
|
||||
|
||||
mockConfigurationValues.IS_MULTIWORKSPACE_ENABLED = false;
|
||||
mockConfigurationValues.IS_WORKSPACE_CREATION_LIMITED_TO_SERVER_ADMINS =
|
||||
false;
|
||||
mockConfigurationValues.IS_WORKSPACE_CREATION_LIMITED_TO_SERVER_ADMINS = false;
|
||||
mockWorkspaceRepository.count.mockResolvedValue(1);
|
||||
jest
|
||||
.spyOn((service as any).userService, 'findUserByEmail')
|
||||
|
||||
+2
-4
@@ -26,8 +26,7 @@ export interface UserWorkspaceAuthContext extends BaseWorkspaceAuthContext {
|
||||
workspaceMember: NonNullable<RawAuthContext['workspaceMember']>;
|
||||
}
|
||||
|
||||
export interface ApplicationWorkspaceAuthContext
|
||||
extends BaseWorkspaceAuthContext {
|
||||
export interface ApplicationWorkspaceAuthContext extends BaseWorkspaceAuthContext {
|
||||
type: 'application';
|
||||
application: NonNullable<RawAuthContext['application']>;
|
||||
}
|
||||
@@ -36,8 +35,7 @@ export interface SystemWorkspaceAuthContext extends BaseWorkspaceAuthContext {
|
||||
type: 'system';
|
||||
}
|
||||
|
||||
export interface PendingActivationUserWorkspaceAuthContext
|
||||
extends BaseWorkspaceAuthContext {
|
||||
export interface PendingActivationUserWorkspaceAuthContext extends BaseWorkspaceAuthContext {
|
||||
type: 'pendingActivationUser';
|
||||
userWorkspaceId: NonNullable<RawAuthContext['userWorkspaceId']>;
|
||||
user: NonNullable<RawAuthContext['user']>;
|
||||
|
||||
+2
-3
@@ -4,9 +4,8 @@ import { fastDeepEqual } from 'twenty-shared/utils';
|
||||
import { type BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
|
||||
export const objectRecordChangedProperties = <
|
||||
PRecord extends Partial<
|
||||
ObjectRecord | BaseWorkspaceEntity
|
||||
> = Partial<ObjectRecord>,
|
||||
PRecord extends Partial<ObjectRecord | BaseWorkspaceEntity> =
|
||||
Partial<ObjectRecord>,
|
||||
>(
|
||||
oldRecord: PRecord,
|
||||
newRecord: PRecord,
|
||||
|
||||
+1
-3
@@ -3,9 +3,7 @@ import { type ExceptionHandlerOptions } from 'src/engine/core-modules/exception-
|
||||
|
||||
import { type ExceptionHandlerDriverInterface } from 'src/engine/core-modules/exception-handler/interfaces';
|
||||
|
||||
export class ExceptionHandlerConsoleDriver
|
||||
implements ExceptionHandlerDriverInterface
|
||||
{
|
||||
export class ExceptionHandlerConsoleDriver implements ExceptionHandlerDriverInterface {
|
||||
captureExceptions(
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
exceptions: ReadonlyArray<any>,
|
||||
|
||||
+1
-3
@@ -12,9 +12,7 @@ import { type ExceptionHandlerDriverInterface } from 'src/engine/core-modules/ex
|
||||
import { MessageImportDriverException } from 'src/modules/messaging/message-import-manager/drivers/exceptions/message-import-driver.exception';
|
||||
import { CustomException } from 'src/utils/custom-exception';
|
||||
|
||||
export class ExceptionHandlerSentryDriver
|
||||
implements ExceptionHandlerDriverInterface
|
||||
{
|
||||
export class ExceptionHandlerSentryDriver implements ExceptionHandlerDriverInterface {
|
||||
captureExceptions(
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
exceptions: ReadonlyArray<any>,
|
||||
|
||||
+1
-3
@@ -5,9 +5,7 @@ import { type ExceptionHandlerOptions } from 'src/engine/core-modules/exception-
|
||||
import { type ExceptionHandlerDriverInterface } from 'src/engine/core-modules/exception-handler/interfaces';
|
||||
|
||||
@Injectable()
|
||||
export class ExceptionHandlerMockService
|
||||
implements ExceptionHandlerDriverInterface
|
||||
{
|
||||
export class ExceptionHandlerMockService implements ExceptionHandlerDriverInterface {
|
||||
captureExceptions(
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
exceptions: readonly any[],
|
||||
|
||||
+1
-3
@@ -12,9 +12,7 @@ import { GraphQLError } from 'graphql';
|
||||
* and leave it to the GraphQL layer to handle the error.
|
||||
*/
|
||||
@Catch(GraphQLError)
|
||||
export class PreventNestToAutoLogGraphqlErrorsFilter
|
||||
implements ExceptionFilter
|
||||
{
|
||||
export class PreventNestToAutoLogGraphqlErrorsFilter implements ExceptionFilter {
|
||||
catch(exception: GraphQLError, _host: ArgumentsHost) {
|
||||
return exception;
|
||||
}
|
||||
|
||||
+1
-3
@@ -10,9 +10,7 @@ import {
|
||||
} from 'class-validator';
|
||||
|
||||
@ValidatorConstraint({ async: false })
|
||||
export class IsX509CertificateConstraint
|
||||
implements ValidatorConstraintInterface
|
||||
{
|
||||
export class IsX509CertificateConstraint implements ValidatorConstraintInterface {
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
validate(value: any) {
|
||||
if (typeof value !== 'string') {
|
||||
|
||||
+1
-3
@@ -13,9 +13,7 @@ import {
|
||||
} from 'src/engine/core-modules/twenty-config/twenty-config.exception';
|
||||
|
||||
@Catch(ConfigVariableException)
|
||||
export class ConfigVariableGraphqlApiExceptionFilter
|
||||
implements ExceptionFilter
|
||||
{
|
||||
export class ConfigVariableGraphqlApiExceptionFilter implements ExceptionFilter {
|
||||
catch(exception: ConfigVariableException) {
|
||||
switch (exception.code) {
|
||||
case ConfigVariableExceptionCode.VARIABLE_NOT_FOUND:
|
||||
|
||||
+1
-3
@@ -7,6 +7,4 @@
|
||||
* |___/
|
||||
*/
|
||||
|
||||
export const TWENTY_NEXT_VERSIONS = [
|
||||
'2.9.0',
|
||||
] as const;
|
||||
export const TWENTY_NEXT_VERSIONS = ['2.9.0'] as const;
|
||||
|
||||
+1
-3
@@ -33,9 +33,7 @@ export const handleWorkflowTriggerException = (
|
||||
};
|
||||
|
||||
@Catch(WorkflowTriggerException)
|
||||
export class WorkflowTriggerGraphqlApiExceptionFilter
|
||||
implements ExceptionFilter
|
||||
{
|
||||
export class WorkflowTriggerGraphqlApiExceptionFilter implements ExceptionFilter {
|
||||
catch(exception: WorkflowTriggerException) {
|
||||
handleWorkflowTriggerException(exception);
|
||||
}
|
||||
|
||||
+1
-3
@@ -26,9 +26,7 @@ export const handleWorkflowVersionEdgeException = (
|
||||
};
|
||||
|
||||
@Catch(WorkflowVersionEdgeException)
|
||||
export class WorkflowVersionEdgeGraphqlApiExceptionFilter
|
||||
implements ExceptionFilter
|
||||
{
|
||||
export class WorkflowVersionEdgeGraphqlApiExceptionFilter implements ExceptionFilter {
|
||||
catch(exception: WorkflowVersionEdgeException) {
|
||||
handleWorkflowVersionEdgeException(exception);
|
||||
}
|
||||
|
||||
+1
-3
@@ -30,9 +30,7 @@ export const handleWorkflowVersionStepException = (
|
||||
};
|
||||
|
||||
@Catch(WorkflowVersionStepException)
|
||||
export class WorkflowVersionStepGraphqlApiExceptionFilter
|
||||
implements ExceptionFilter
|
||||
{
|
||||
export class WorkflowVersionStepGraphqlApiExceptionFilter implements ExceptionFilter {
|
||||
catch(exception: WorkflowVersionStepException) {
|
||||
handleWorkflowVersionStepException(exception);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user