[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:
@ -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([
|
||||
|
||||
@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -74,6 +74,7 @@ export class WorkspaceObjectComparator {
|
||||
|
||||
const property = difference.path[0];
|
||||
|
||||
// @ts-expect-error legacy noImplicitAny
|
||||
objectPropertiesToUpdate[property] = standardObjectMetadata[property];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user