Zomars/fixes trpc typo (#957)

pull/960/head
Omar López 2021-10-14 13:22:01 -06:00 committed by GitHub
parent 2ce2bb1ca8
commit c2c37b701e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 25 additions and 20 deletions

View File

@ -7,6 +7,6 @@ module.exports = {
semi: true,
printWidth: 110,
arrowParens: "always",
importOrder: ["^@ee/(.*)$", "^@lib/(.*)$", "^@components/(.*)$", "^@(server|trcp)/(.*)$", "^[./]"],
importOrder: ["^@ee/(.*)$", "^@lib/(.*)$", "^@components/(.*)$", "^@(server|trpc)/(.*)$", "^[./]"],
importOrderSeparation: true,
};

View File

@ -1,10 +1,11 @@
import * as AvatarPrimitive from "@radix-ui/react-avatar";
import * as Tooltip from "@radix-ui/react-tooltip";
import { Maybe } from "@trpc/server";
import classNames from "@lib/classNames";
import { defaultAvatarSrc } from "@lib/profile";
import { Maybe } from "@trpc/server";
export type AvatarProps = {
className?: string;
size?: number;

View File

@ -1,7 +1,8 @@
import { loadStripe, Stripe } from "@stripe/stripe-js";
import { Maybe } from "@trpc/server";
import { stringify } from "querystring";
import { Maybe } from "@trpc/server";
const stripePublicKey = process.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY!;
let stripePromise: Promise<Stripe | null>;

View File

@ -1,10 +1,11 @@
import { Maybe } from "@trpc/server";
import parser from "accept-language-parser";
import { IncomingMessage } from "http";
import { getSession } from "@lib/auth";
import prisma from "@lib/prisma";
import { Maybe } from "@trpc/server";
import { i18n } from "../../../next-i18next.config";
export function getLocaleFromHeaders(req: IncomingMessage): string {

View File

@ -1,6 +1,7 @@
import { Maybe } from "@trpc/server";
import { useEffect, useState } from "react";
import { Maybe } from "@trpc/server";
// makes sure the ui doesn't flash
export default function useTheme(theme?: Maybe<string>) {
const [isReady, setIsReady] = useState(false);

View File

@ -1,10 +1,10 @@
// Type-only import:
// https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export
import { createReactQueryHooks } from "@trpc/react";
import type { inferProcedureOutput, inferProcedureInput } from "@trpc/server";
import superjson from "superjson";
import type { AppRouter } from "@server/routers/_app";
import { createReactQueryHooks } from "@trpc/react";
import type { inferProcedureOutput, inferProcedureInput } from "@trpc/server";
/**
* A set of strongly-typed React hooks from your `AppRouter` type signature with `createReactQueryHooks`.

View File

@ -1,8 +1,3 @@
import { httpBatchLink } from "@trpc/client/links/httpBatchLink";
import { loggerLink } from "@trpc/client/links/loggerLink";
import { withTRPC } from "@trpc/next";
import type { TRPCClientErrorLike } from "@trpc/react";
import { Maybe } from "@trpc/server";
import { DefaultSeo } from "next-seo";
import type { AppProps as NextAppProps } from "next/app";
import superjson from "superjson";
@ -13,6 +8,11 @@ import { seoConfig } from "@lib/config/next-seo.config";
import I18nLanguageHandler from "@components/I18nLanguageHandler";
import type { AppRouter } from "@server/routers/_app";
import { httpBatchLink } from "@trpc/client/links/httpBatchLink";
import { loggerLink } from "@trpc/client/links/loggerLink";
import { withTRPC } from "@trpc/next";
import type { TRPCClientErrorLike } from "@trpc/react";
import { Maybe } from "@trpc/server";
import "../styles/globals.css";

View File

@ -1,10 +1,9 @@
/**
* This file contains tRPC's HTTP response handler
*/
import * as trpcNext from "@trpc/server/adapters/next";
import { createContext } from "@server/createContext";
import { appRouter } from "@server/routers/_app";
import * as trpcNext from "@trpc/server/adapters/next";
export default trpcNext.createNextApiHandler({
router: appRouter,

View File

@ -1,7 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import * as trpc from "@trpc/server";
import { Maybe } from "@trpc/server";
import * as trpcNext from "@trpc/server/adapters/next";
import { NextApiRequest } from "next";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
@ -10,6 +7,10 @@ import { getLocaleFromHeaders } from "@lib/core/i18n/i18n.utils";
import prisma from "@lib/prisma";
import { defaultAvatarSrc } from "@lib/profile";
import * as trpc from "@trpc/server";
import { Maybe } from "@trpc/server";
import * as trpcNext from "@trpc/server/adapters/next";
async function getUserFromSession({ session, req }: { session: Maybe<Session>; req: NextApiRequest }) {
if (!session?.user?.id) {
return null;

View File

@ -1,5 +1,4 @@
import { BookingStatus, Prisma } from "@prisma/client";
import { TRPCError } from "@trpc/server";
import _ from "lodash";
import { getErrorFromUnknown } from "pages/_error";
import { z } from "zod";
@ -10,6 +9,8 @@ import { checkRegularUsername } from "@lib/core/checkRegularUsername";
import { ALL_INTEGRATIONS } from "@lib/integrations/getIntegrations";
import slugify from "@lib/slugify";
import { TRPCError } from "@trpc/server";
import { getCalendarAdapterOrNull } from "../../lib/calendarClient";
import { createProtectedRouter, createRouter } from "../createRouter";
import { resizeBase64Image } from "../lib/resizeBase64Image";

View File

@ -1,7 +1,7 @@
import { createSSGHelpers } from "@trpc/react/ssg";
import prisma from "@lib/prisma";
import { createSSGHelpers } from "@trpc/react/ssg";
import { appRouter } from "./routers/_app";
export const ssg = createSSGHelpers({