[QRQC_2] No implicitAny in twenty-server (#12075)

# Introduction
Following https://github.com/twentyhq/twenty/pull/12068
Related with https://github.com/twentyhq/core-team-issues/issues/975

We're enabling `noImplicitAny` handled few use case manually, added a
`ts-expect-error` to the others, we should plan to handle them in the
future
This commit is contained in:
Paul Rastoin
2025-05-15 18:23:22 +02:00
committed by GitHub
parent 08ce2f831e
commit 442f8dbe3c
120 changed files with 331 additions and 50 deletions

View File

@ -46,6 +46,7 @@ describe('people resolvers (integration)', () => {
expect(response.body.data.createPeople).toHaveLength(2);
// @ts-expect-error legacy noImplicitAny
response.body.data.createPeople.forEach((person) => {
expect(person).toHaveProperty('city');
expect([personCity1, personCity2]).toContain(person.city);
@ -168,6 +169,7 @@ describe('people resolvers (integration)', () => {
expect(updatedPeople).toHaveLength(2);
// @ts-expect-error legacy noImplicitAny
updatedPeople.forEach((person) => {
expect(person.city).toEqual('Updated City');
});
@ -241,6 +243,7 @@ describe('people resolvers (integration)', () => {
expect(deletePeople).toHaveLength(2);
// @ts-expect-error legacy noImplicitAny
deletePeople.forEach((person) => {
expect(person.deletedAt).toBeTruthy();
});

View File

@ -56,6 +56,7 @@ describe('SearchResolver', () => {
});
const listingObjectMetadata = objectsMetadata.find(
// @ts-expect-error legacy noImplicitAny
(object) => object.nameSingular === LISTING_NAME_SINGULAR,
);

View File

@ -63,10 +63,12 @@ describe('roles permissions', () => {
.send(query);
adminRoleId = resp.body.data.getRoles.find(
// @ts-expect-error legacy noImplicitAny
(role) => role.label === 'Admin',
).id;
guestRoleId = resp.body.data.getRoles.find(
// @ts-expect-error legacy noImplicitAny
(role) => role.label === 'Guest',
).id;
});
@ -231,10 +233,12 @@ describe('roles permissions', () => {
.send(getRolesQuery);
const memberRoleId = resp.body.data.getRoles.find(
// @ts-expect-error legacy noImplicitAny
(role) => role.label === 'Member',
).id;
const guestRoleId = resp.body.data.getRoles.find(
// @ts-expect-error legacy noImplicitAny
(role) => role.label === 'Guest',
).id;

View File

@ -10,7 +10,7 @@ import { PermissionsExceptionMessage } from 'src/engine/metadata-modules/permiss
const client = request(`http://localhost:${APP_PORT}`);
describe('Security permissions', () => {
let originalWorkspaceState;
let originalWorkspaceState: Record<string, unknown>;
beforeAll(async () => {
// Store original workspace state

View File

@ -11,7 +11,7 @@ import { PermissionsExceptionMessage } from 'src/engine/metadata-modules/permiss
const client = request(`http://localhost:${APP_PORT}`);
describe('workspace permissions', () => {
let originalWorkspaceState;
let originalWorkspaceState: Record<string, unknown>;
beforeAll(async () => {
// Store original workspace state