[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

@ -18,9 +18,11 @@ describe('WorkspaceRelationComparator', () => {
}
it('should generate CREATE action for new relations', () => {
// @ts-expect-error legacy noImplicitAny
const original = [];
const standard = [createMockRelationMetadata({})];
// @ts-expect-error legacy noImplicitAny
const result = comparator.compare(original, standard);
expect(result).toEqual([
@ -36,8 +38,10 @@ describe('WorkspaceRelationComparator', () => {
it('should generate DELETE action for removed relations', () => {
const original = [createMockRelationMetadata({ id: '1' })];
// @ts-expect-error legacy noImplicitAny
const standard = [];
// @ts-expect-error legacy noImplicitAny
const result = comparator.compare(original, standard);
expect(result).toEqual([

View File

@ -51,10 +51,12 @@ export function transformMetadataForComparison<T, Keys extends keyof T>(
) {
const orderedValue = orderObjectProperties(datum[property] as object);
// @ts-expect-error legacy noImplicitAny
transformedField[property as string] = JSON.stringify(
orderedValue,
) as T[Keys];
} else {
// @ts-expect-error legacy noImplicitAny
transformedField[property as string] = datum[property];
}
}

View File

@ -183,8 +183,10 @@ export class WorkspaceFieldRelationComparator {
}
}
// @ts-expect-error legacy noImplicitAny
propertiesMap[fieldId][property] = newValue;
} else {
// @ts-expect-error legacy noImplicitAny
propertiesMap[fieldId][property] = difference.value;
}
}

View File

@ -191,10 +191,12 @@ export class WorkspaceFieldComparator {
if (
(fieldPropertiesToStringify as readonly string[]).includes(property)
) {
// @ts-expect-error legacy noImplicitAny
fieldPropertiesToUpdateMap[id][property] = this.parseJSONOrString(
difference.value,
);
} else {
// @ts-expect-error legacy noImplicitAny
fieldPropertiesToUpdateMap[id][property] = difference.value;
}
break;

View File

@ -74,6 +74,7 @@ export class WorkspaceObjectComparator {
const property = difference.path[0];
// @ts-expect-error legacy noImplicitAny
objectPropertiesToUpdate[property] = standardObjectMetadata[property];
}
}