Files
twenty/packages/twenty-server/src/engine/metadata-modules/object-metadata/dtos/object-metadata.dto.ts
T
Félix Malfait c3dd6b25a6 fix: use canonical oxlint rule id in lint-disable directives (#21253)
## What

Many `oxlint-disable` / `eslint-disable` directives across the repo
carry a corrupted rule id — `@typescripttypescript/<rule>` — most likely
a find-and-replace accident that mangled the eslint-era
`@typescript-eslint/` prefix.

oxlint matches disable directives **loosely by rule name**, so these
still suppress in practice (not a silent no-op), but the id is malformed
and misleading.

## Change

Replace them with the **canonical oxlint id** `typescript/<rule>` —
matching the plugin name and rule keys declared in `.oxlintrc.json` —
**127 files, 262 directives**:

| rule | count |
| --- | ----- |
| `typescript/no-explicit-any` | 250 |
| `typescript/ban-ts-comment` | 6 |
| `typescript/no-misused-promises` | 4 |
| `typescript/no-empty-object-type` | 2 |

- `twenty-server`: 122 files
- `twenty-front`: 5 files

Comment-only — no code or runtime changes.

## Verification

`oxlint --type-aware -c .oxlintrc.json` reports **0 warnings / 0
errors** for both `twenty-server` and `twenty-front`. Every changed line
is exactly the id correction inside a disable directive (262 insertions
/ 262 deletions, no collateral edits).

> Addresses the cubic review, which flagged that the canonical oxlint id
is `typescript/...` (no `@`). Worth noting the original
`@typescripttypescript/` was not actually a silent no-op — oxlint
matches these directives loosely by rule name — but `typescript/` is the
correct, config-aligned id.
2026-06-05 13:52:32 +02:00

107 lines
2.5 KiB
TypeScript

import { Field, HideField, ObjectType } from '@nestjs/graphql';
import {
Authorize,
CursorConnection,
FilterableField,
IDField,
QueryOptions,
} from '@ptc-org/nestjs-query-graphql';
import { type WorkspaceEntityDuplicateCriteria } from 'src/engine/api/graphql/workspace-query-builder/types/workspace-entity-duplicate-criteria.type';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
import { FieldMetadataDTO } from 'src/engine/metadata-modules/field-metadata/dtos/field-metadata.dto';
import { IndexMetadataDTO } from 'src/engine/metadata-modules/index-metadata/dtos/index-metadata.dto';
import { ObjectStandardOverridesDTO } from 'src/engine/metadata-modules/object-metadata/dtos/object-standard-overrides.dto';
@ObjectType('Object')
@Authorize({
// oxlint-disable-next-line typescript/no-explicit-any
authorize: (context: any) => ({
workspaceId: { eq: context?.req?.workspace?.id },
}),
})
@QueryOptions({
defaultResultSize: 10,
disableSort: true,
maxResultsSize: 1000,
})
@CursorConnection('fields', () => FieldMetadataDTO)
@CursorConnection('indexMetadatas', () => IndexMetadataDTO)
export class ObjectMetadataDTO {
@IDField(() => UUIDScalarType)
id: string;
@Field()
universalIdentifier: string;
@Field()
nameSingular: string;
@Field()
namePlural: string;
@Field()
labelSingular: string;
@Field()
labelPlural: string;
@Field({ nullable: true })
description?: string;
@Field({ nullable: true })
icon?: string;
@Field(() => ObjectStandardOverridesDTO, { nullable: true })
standardOverrides?: ObjectStandardOverridesDTO;
@Field({ nullable: true })
shortcut?: string;
@Field({ nullable: true })
color?: string;
@FilterableField()
isCustom: boolean;
@FilterableField()
isRemote: boolean;
@FilterableField()
isActive: boolean;
@FilterableField()
isSystem: boolean;
@FilterableField()
isUIReadOnly: boolean;
@FilterableField()
isSearchable: boolean;
@HideField()
workspaceId: string;
@Field(() => UUIDScalarType)
applicationId: string;
@Field()
createdAt: Date;
@Field()
updatedAt: Date;
@Field(() => UUIDScalarType, { nullable: true })
labelIdentifierFieldMetadataId?: string | null;
@Field(() => UUIDScalarType, { nullable: true })
imageIdentifierFieldMetadataId?: string | null;
@Field()
isLabelSyncedWithName: boolean;
@Field(() => [[String]], { nullable: true })
duplicateCriteria?: WorkspaceEntityDuplicateCriteria[];
}