Enforces explicit type imports (#7158)

* Enforces explicit type imports

* Upgrades typescript-eslint

* Upgrades eslint related dependencies

* Update config

* Sync packages mismatches

* Syncs prettier version

* Linting

* Relocks node version

* Fixes

* Locks @vitejs/plugin-react to 1.3.2

* Linting
This commit is contained in:
Omar López authored and GitHub committed 2023-02-16 15:39:57 -07:00
1 parent 3df289b557
commit 7c749299bb
425 files changed
+1216 -1069

No files matched your search

@@ -1,16 +1,18 @@
import {
import type {
BookingReference,
BookingStatus,
EventType,
MembershipRole,
Prisma,
SchedulingType,
User,
WebhookTriggerEvents,
Workflow,
WorkflowsOnEventTypes,
WorkflowStep,
PrismaPromise,
} from "@prisma/client";
import {
BookingStatus,
MembershipRole,
Prisma,
SchedulingType,
WebhookTriggerEvents,
WorkflowMethods,
} from "@prisma/client";
import type { TFunction } from "next-i18next";
@@ -36,7 +38,8 @@ import {
} from "@calcom/emails";
import { scheduleWorkflowReminders } from "@calcom/features/ee/workflows/lib/reminders/reminderScheduler";
import getWebhooks from "@calcom/features/webhooks/lib/getWebhooks";
import sendPayload, { EventTypeInfo } from "@calcom/features/webhooks/lib/sendPayload";
import type { EventTypeInfo } from "@calcom/features/webhooks/lib/sendPayload";
import sendPayload from "@calcom/features/webhooks/lib/sendPayload";
import { isPrismaObjOrUndefined, parseRecurringEvent } from "@calcom/lib";
import logger from "@calcom/lib/logger";
import { getTranslation } from "@calcom/lib/server";
@@ -325,7 +328,7 @@ export const bookingsRouter = router({
const recurringInfo = recurringInfoBasic.map(
(
info: typeof recurringInfoBasic[number]
info: (typeof recurringInfoBasic)[number]
): {
recurringEventId: string | null;
count: number;
@@ -13,9 +13,9 @@ import { CAL_URL } from "@calcom/lib/constants";
import getEventTypeById from "@calcom/lib/getEventTypeById";
import { baseEventTypeSelect, baseUserSelect } from "@calcom/prisma";
import { _DestinationCalendarModel, _EventTypeModel } from "@calcom/prisma/zod";
import type { CustomInputSchema } from "@calcom/prisma/zod-utils";
import {
customInputSchema,
CustomInputSchema,
EventTypeMetaDataSchema,
stringOrNumber,
userMetadata as userMetadataSchema,
@@ -271,7 +271,7 @@ export const eventTypesRouter = router({
throw new TRPCError({ code: "INTERNAL_SERVER_ERROR" });
}
const mapEventType = (eventType: typeof user.eventTypes[number]) => ({
const mapEventType = (eventType: (typeof user.eventTypes)[number]) => ({
...eventType,
users: !!eventType.hosts?.length ? eventType.hosts.map((host) => host.user) : eventType.users,
// @FIXME: cc @hariombalhara This is failing with production data
@@ -300,8 +300,8 @@ export const eventTypesRouter = router({
type EventTypeGroup = {
teamId?: number | null;
profile: {
slug: typeof user["username"];
name: typeof user["name"];
slug: (typeof user)["username"];
name: (typeof user)["name"];
image?: string;
};
metadata: {
@@ -687,7 +687,7 @@ export const viewerTeamsRouter = router({
},
},
});
type UserMap = Record<number, typeof teams[number]["members"][number]["user"]>;
type UserMap = Record<number, (typeof teams)[number]["members"][number]["user"]>;
// flattern users to be unique by id
const users = teams
.flatMap((t) => t.members)