[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

@ -187,9 +187,11 @@ describe('UpgradeCommandRunner', () => {
workspaces: [higherVersionWorkspace],
appVersion,
});
// @ts-expect-error legacy noImplicitAny
const passedParams = [];
const options = {};
// @ts-expect-error legacy noImplicitAny
await upgradeCommandRunner.run(passedParams, options);
const { fail: failReport, success: successReport } =
@ -239,9 +241,11 @@ describe('UpgradeCommandRunner', () => {
workspaces: failingWorkspaces,
appVersion,
});
// @ts-expect-error legacy noImplicitAny
const passedParams = [];
const options = {};
// @ts-expect-error legacy noImplicitAny
await upgradeCommandRunner.run(passedParams, options);
// Common assertions
@ -287,9 +291,11 @@ describe('UpgradeCommandRunner', () => {
numberOfWorkspace,
appVersion,
});
// @ts-expect-error legacy noImplicitAny
const passedParams = [];
const options = {};
// @ts-expect-error legacy noImplicitAny
await upgradeCommandRunner.run(passedParams, options);
[
@ -310,9 +316,11 @@ describe('UpgradeCommandRunner', () => {
it('should run syncMetadataCommand betweensuccessful beforeSyncMetadataUpgradeCommandsToRun and afterSyncMetadataUpgradeCommandsToRun', async () => {
await buildModuleAndSetupSpies({});
// @ts-expect-error legacy noImplicitAny
const passedParams = [];
const options = {};
// @ts-expect-error legacy noImplicitAny
await upgradeCommandRunner.run(passedParams, options);
[
@ -380,9 +388,11 @@ describe('UpgradeCommandRunner', () => {
async ({ context: { input } }) => {
await buildModuleAndSetupSpies(input);
// @ts-expect-error legacy noImplicitAny
const passedParams = [];
const options = {};
// @ts-expect-error legacy noImplicitAny
await upgradeCommandRunner.run(passedParams, options);
const { fail: failReport, success: successReport } =
@ -461,9 +471,11 @@ describe('UpgradeCommandRunner', () => {
it.each(failingTestUseCases)('$title', async ({ context: { input } }) => {
await buildModuleAndSetupSpies(input);
// @ts-expect-error legacy noImplicitAny
const passedParams = [];
const options = {};
// @ts-expect-error legacy noImplicitAny
await upgradeCommandRunner.run(passedParams, options);
const { fail: failReport, success: successReport } =

View File

@ -8,6 +8,7 @@ interface CommandLoggerOptions {
export const isCommandLogger = (
logger: Logger | CommandLogger,
): logger is CommandLogger => {
// @ts-expect-error legacy noImplicitAny
return typeof logger['setVerbose'] === 'function';
};

View File

@ -64,9 +64,11 @@ export class AddTasksAssignedToMeViewCommand extends ActiveOrSuspendedWorkspaces
});
const objectMetadataMap = objectMetadata.reduce((acc, object) => {
// @ts-expect-error legacy noImplicitAny
acc[object.standardId ?? ''] = {
id: object.id,
fields: object.fields.reduce((acc, field) => {
// @ts-expect-error legacy noImplicitAny
acc[field.standardId ?? ''] = field.id;
return acc;

View File

@ -59,6 +59,7 @@ export class CopyTypeormMigrationsCommand extends ActiveOrSuspendedWorkspacesMig
);
const existingMigrationNames = new Set(
// @ts-expect-error legacy noImplicitAny
existingCoreMigrations.map((migration) => migration.name),
);