New linting rules

pull/9078/head
zomars 2023-02-16 14:01:40 -07:00
parent f02cfc9990
commit 42eb7041d4
34 changed files with 38 additions and 41 deletions

View File

@ -1,5 +1,5 @@
import { nanoid } from "nanoid";
import { NextMiddleware } from "next-api-middleware";
import type { NextMiddleware } from "next-api-middleware";
export const addRequestId: NextMiddleware = async (_req, res, next) => {
// Apply header with unique ID to every request

View File

@ -1,5 +1,5 @@
import * as Sentry from "@sentry/nextjs";
import { NextMiddleware } from "next-api-middleware";
import type { NextMiddleware } from "next-api-middleware";
export const captureErrors: NextMiddleware = async (_req, res, next) => {
try {

View File

@ -1,5 +1,5 @@
import { PrismaClient } from "@prisma/client";
import { NextMiddleware } from "next-api-middleware";
import type { NextMiddleware } from "next-api-middleware";
import { CONSOLE_URL } from "@calcom/lib/constants";

View File

@ -1,4 +1,4 @@
import { NextMiddleware } from "next-api-middleware";
import type { NextMiddleware } from "next-api-middleware";
export const extendRequest: NextMiddleware = async (req, res, next) => {
req.pagination = {

View File

@ -1,4 +1,4 @@
import { NextMiddleware } from "next-api-middleware";
import type { NextMiddleware } from "next-api-middleware";
export const httpMethod = (allowedHttpMethod: "GET" | "POST" | "PATCH" | "DELETE"): NextMiddleware => {
return async function (req, res, next) {

View File

@ -1,4 +1,4 @@
import { NextMiddleware } from "next-api-middleware";
import type { NextMiddleware } from "next-api-middleware";
import { hashAPIKey } from "@calcom/features/ee/api-keys/lib/apiKeys";
import checkLicense from "@calcom/features/ee/common/server/checkLicense";

View File

@ -1,4 +1,4 @@
import { NextMiddleware } from "next-api-middleware";
import type { NextMiddleware } from "next-api-middleware";
import z from "zod";
const withPage = z.object({

View File

@ -1,5 +1,5 @@
import type { EventLocationType } from "@calcom/app-store/locations";
import {
import type {
Attendee,
Availability,
Booking,

View File

@ -1,4 +1,4 @@
import { NextApiRequest, NextApiResponse } from "next";
import type { NextApiRequest, NextApiResponse } from "next";
import { defaultHandler, defaultResponder } from "@calcom/lib/server";

View File

@ -2,7 +2,7 @@ import type { Prisma } from "@prisma/client";
import type { NextApiRequest } from "next";
import { defaultResponder } from "@calcom/lib/server";
import { Ensure } from "@calcom/types/utils";
import type { Ensure } from "@calcom/types/utils";
import { apiKeyPublicSchema } from "~/lib/validations/api-key";
import { schemaQuerySingleOrMultipleUserIds } from "~/lib/validations/shared/queryUserId";

View File

@ -1,5 +1,5 @@
import type { NextApiRequest } from "next";
import { z } from "zod";
import type { z } from "zod";
import { HttpError } from "@calcom/lib/http-error";
import { defaultResponder } from "@calcom/lib/server";

View File

@ -1,4 +1,4 @@
import { NextApiRequest, NextApiResponse } from "next";
import type { NextApiRequest, NextApiResponse } from "next";
import { defaultHandler, defaultResponder } from "@calcom/lib/server";

View File

@ -1,4 +1,4 @@
import { NextApiRequest, NextApiResponse } from "next";
import type { NextApiRequest, NextApiResponse } from "next";
import { defaultHandler, defaultResponder } from "@calcom/lib/server";

View File

@ -1,4 +1,4 @@
import { NextApiRequest, NextApiResponse } from "next";
import type { NextApiRequest, NextApiResponse } from "next";
import { defaultHandler, defaultResponder } from "@calcom/lib/server";

View File

@ -1,5 +1,5 @@
import type { NextApiRequest } from "next";
import { z } from "zod";
import type { z } from "zod";
import { HttpError } from "@calcom/lib/http-error";
import { defaultResponder } from "@calcom/lib/server";

View File

@ -1,4 +1,4 @@
import { NextApiRequest, NextApiResponse } from "next";
import type { NextApiRequest, NextApiResponse } from "next";
import { defaultHandler } from "@calcom/lib/server";

View File

@ -1,4 +1,4 @@
import { NextApiRequest, NextApiResponse } from "next";
import type { NextApiRequest, NextApiResponse } from "next";
import { defaultHandler, defaultResponder } from "@calcom/lib/server";

View File

@ -1,4 +1,4 @@
import { Prisma } from "@prisma/client";
import type { Prisma } from "@prisma/client";
import type { NextApiRequest } from "next";
import { HttpError } from "@calcom/lib/http-error";

View File

@ -1,4 +1,4 @@
import { NextApiRequest, NextApiResponse } from "next";
import type { NextApiRequest, NextApiResponse } from "next";
import { defaultHandler, defaultResponder } from "@calcom/lib/server";

View File

@ -1,7 +1,7 @@
import type { NextApiRequest, NextApiResponse } from "next";
import { withMiddleware } from "~/lib/helpers/withMiddleware";
import { DestinationCalendarResponse, DestinationCalendarsResponse } from "~/lib/types";
import type { DestinationCalendarResponse, DestinationCalendarsResponse } from "~/lib/types";
import {
schemaDestinationCalendarCreateBodyParams,
schemaDestinationCalendarReadPublic,

View File

@ -1,7 +1,7 @@
import modifyRes from "modify-response-middleware";
import { use } from "next-api-middleware";
import { withSwagger } from "next-swagger-doc";
import { NextApiRequest, NextApiResponse } from "next/types";
import type { NextApiRequest, NextApiResponse } from "next/types";
import pjson from "~/package.json";

View File

@ -1,14 +1,11 @@
import type { NextApiRequest } from "next";
import { z } from "zod";
import type { z } from "zod";
import { HttpError } from "@calcom/lib/http-error";
import { defaultResponder } from "@calcom/lib/server";
import {
schemaEventTypeEditBodyParams,
schemaEventTypeBaseBodyParams,
schemaEventTypeReadPublic,
} from "~/lib/validations/event-type";
import type { schemaEventTypeBaseBodyParams } from "~/lib/validations/event-type";
import { schemaEventTypeEditBodyParams, schemaEventTypeReadPublic } from "~/lib/validations/event-type";
import { schemaQueryIdParseInt } from "~/lib/validations/shared/queryIdTransformParseInt";
import checkTeamEventEditPermission from "../_utils/checkTeamEventEditPermission";

View File

@ -1,4 +1,4 @@
import { NextApiRequest, NextApiResponse } from "next";
import type { NextApiRequest, NextApiResponse } from "next";
import { defaultHandler, defaultResponder } from "@calcom/lib/server";

View File

@ -1,9 +1,9 @@
import type { NextApiRequest } from "next";
import { z } from "zod";
import type { z } from "zod";
import { HttpError } from "@calcom/lib/http-error";
import { schemaEventTypeBaseBodyParams } from "~/lib/validations/event-type";
import type { schemaEventTypeBaseBodyParams } from "~/lib/validations/event-type";
export default async function checkTeamEventEditPermission(
req: NextApiRequest,

View File

@ -1,4 +1,4 @@
import { Prisma } from "@prisma/client";
import type { Prisma } from "@prisma/client";
import type { NextApiRequest } from "next";
import { defaultResponder } from "@calcom/lib/server";

View File

@ -1,4 +1,4 @@
import { Prisma } from "@prisma/client";
import type { Prisma } from "@prisma/client";
import type { NextApiRequest } from "next";
import { HttpError } from "@calcom/lib/http-error";

View File

@ -1,7 +1,7 @@
import type { NextApiRequest, NextApiResponse } from "next";
import { withMiddleware } from "~/lib/helpers/withMiddleware";
import { PaymentsResponse } from "~/lib/types";
import type { PaymentsResponse } from "~/lib/types";
import { schemaPaymentPublic } from "~/lib/validations/payment";
/**

View File

@ -1,5 +1,5 @@
import type { NextApiRequest } from "next";
import { z } from "zod";
import type { z } from "zod";
import { HttpError } from "@calcom/lib/http-error";
import { defaultResponder } from "@calcom/lib/server";

View File

@ -1,4 +1,4 @@
import { Prisma } from "@prisma/client";
import type { Prisma } from "@prisma/client";
import type { NextApiRequest } from "next";
import { purchaseTeamSubscription } from "@calcom/features/ee/teams/lib/payments";

View File

@ -1,4 +1,4 @@
import { NextApiRequest, NextApiResponse } from "next";
import type { NextApiRequest, NextApiResponse } from "next";
import { defaultHandler, defaultResponder } from "@calcom/lib/server";

View File

@ -1,5 +1,5 @@
import { MembershipRole, UserPermissionRole } from "@prisma/client";
import { NextApiRequest, NextApiResponse } from "next";
import type { NextApiRequest, NextApiResponse } from "next";
import { HttpError } from "@calcom/lib/http-error";
import { defaultHandler, defaultResponder } from "@calcom/lib/server";

View File

@ -1,4 +1,4 @@
import { Prisma } from "@prisma/client";
import type { Prisma } from "@prisma/client";
import type { NextApiRequest } from "next";
import { defaultResponder } from "@calcom/lib/server";

View File

@ -1,4 +1,4 @@
import { Prisma } from "@prisma/client";
import type { Prisma } from "@prisma/client";
import type { NextApiRequest } from "next";
import { defaultResponder } from "@calcom/lib/server";

View File

@ -1,5 +1,5 @@
import { Request, Response } from "express";
import { NextApiRequest, NextApiResponse } from "next";
import type { Request, Response } from "express";
import type { NextApiRequest, NextApiResponse } from "next";
import { createMocks } from "node-mocks-http";
import dayjs from "@calcom/dayjs";