Skip to content

Commit

Permalink
Revert "chore: apply lint and formatting fixes"
Browse files Browse the repository at this point in the history
This reverts commit 0e9c5d3.
  • Loading branch information
KATT committed Mar 1, 2024
1 parent bbb7ef6 commit 013ca2f
Show file tree
Hide file tree
Showing 19 changed files with 117 additions and 123 deletions.
16 changes: 5 additions & 11 deletions examples/next-prisma-websockets-starter/src/server/routers/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,13 @@ interface MyEvents {
isTypingUpdate: () => void;
}
declare interface MyEventEmitter {
on: <TEv extends keyof MyEvents>(event: TEv, listener: MyEvents[TEv]) => this;
off: <TEv extends keyof MyEvents>(
event: TEv,
listener: MyEvents[TEv],
) => this;
once: <TEv extends keyof MyEvents>(
event: TEv,
listener: MyEvents[TEv],
) => this;
emit: <TEv extends keyof MyEvents>(
on<TEv extends keyof MyEvents>(event: TEv, listener: MyEvents[TEv]): this;
off<TEv extends keyof MyEvents>(event: TEv, listener: MyEvents[TEv]): this;
once<TEv extends keyof MyEvents>(event: TEv, listener: MyEvents[TEv]): this;
emit<TEv extends keyof MyEvents>(
event: TEv,
...args: Parameters<MyEvents[TEv]>
) => boolean;
): boolean;
}

class MyEventEmitter extends EventEmitter {}
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/internals/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface AbortControllerInstanceEsque {
* Sets this object's AbortSignal's aborted flag and signals to
* any observers that the associated activity is to be aborted.
*/
abort: () => void;
abort(): void;
}

/**
Expand Down Expand Up @@ -90,7 +90,7 @@ export interface ResponseEsque {
* that's not as type-safe as unknown. We use unknown because we're
* more type-safe. You do want more type safety, right? 😉
*/
json: () => Promise<unknown>;
json(): Promise<unknown>;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/links/internals/streamingUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
* @internal
*/
export interface TextDecoderEsque {
decode: (chunk: Uint8Array) => string;
decode(chunk: Uint8Array): string;
}
2 changes: 1 addition & 1 deletion packages/client/src/links/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export type Operation<TInput = unknown> = {
};

interface HeadersInitEsque {
[Symbol.iterator]: () => IterableIterator<[string, string]>;
[Symbol.iterator](): IterableIterator<[string, string]>;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/next/src/createTRPCNext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ export interface CreateTRPCNextBase<
*
* @link https://trpc.io/docs/v11/client/react/useUtils
*/
useContext: () => CreateReactUtils<TRouter, TSSRContext>;
useContext(): CreateReactUtils<TRouter, TSSRContext>;
/**
* @link https://trpc.io/docs/v11/client/react/useUtils
*/
useUtils: () => CreateReactUtils<TRouter, TSSRContext>;
useUtils(): CreateReactUtils<TRouter, TSSRContext>;
withTRPC: ReturnType<typeof withTRPC<TRouter, TSSRContext>>;
useQueries: TRPCUseQueries<TRouter>;
useSuspenseQueries: TRPCUseSuspenseQueries<TRouter>;
Expand Down
4 changes: 2 additions & 2 deletions packages/react-query/src/createTRPCReact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,11 @@ export type CreateTRPCReactBase<TRouter extends AnyRouter, TSSRContext> = {
*
* @link https://trpc.io/docs/v11/client/react/useUtils
*/
useContext: () => CreateReactUtils<TRouter, TSSRContext>;
useContext(): CreateReactUtils<TRouter, TSSRContext>;
/**
* @link https://trpc.io/docs/v11/client/react/useUtils
*/
useUtils: () => CreateReactUtils<TRouter, TSSRContext>;
useUtils(): CreateReactUtils<TRouter, TSSRContext>;
Provider: TRPCProvider<TRouter, TSSRContext>;
createClient: CreateClient<TRouter>;
useQueries: TRPCUseQueries<TRouter>;
Expand Down
16 changes: 8 additions & 8 deletions packages/react-query/src/server/ssgProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,25 @@ type DecorateProcedure<
/**
* @link https://tanstack.com/query/v5/docs/framework/react/guides/prefetching
*/
fetch: (
fetch(
input: inferProcedureInput<TProcedure>,
opts?: TRPCFetchQueryOptions<
inferTransformedProcedureOutput<TRoot, TProcedure>,
TRPCClientError<TRoot>
>,
) => Promise<inferTransformedProcedureOutput<TRoot, TProcedure>>;
): Promise<inferTransformedProcedureOutput<TRoot, TProcedure>>;

/**
* @link https://tanstack.com/query/v5/docs/framework/react/guides/prefetching
*/
fetchInfinite: (
fetchInfinite(
input: inferProcedureInput<TProcedure>,
opts?: TRPCFetchInfiniteQueryOptions<
inferProcedureInput<TProcedure>,
inferTransformedProcedureOutput<TRoot, TProcedure>,
TRPCClientError<TRoot>
>,
) => Promise<
): Promise<
InfiniteData<
inferTransformedProcedureOutput<TRoot, TProcedure>,
NonNullable<ExtractCursorType<inferProcedureInput<TProcedure>>> | null
Expand All @@ -87,25 +87,25 @@ type DecorateProcedure<
/**
* @link https://tanstack.com/query/v5/docs/framework/react/guides/prefetching
*/
prefetch: (
prefetch(
input: inferProcedureInput<TProcedure>,
opts?: TRPCFetchQueryOptions<
inferTransformedProcedureOutput<TRoot, TProcedure>,
TRPCClientError<TRoot>
>,
) => Promise<void>;
): Promise<void>;

/**
* @link https://tanstack.com/query/v5/docs/framework/react/guides/prefetching
*/
prefetchInfinite: (
prefetchInfinite(
input: inferProcedureInput<TProcedure>,
opts?: TRPCFetchInfiniteQueryOptions<
inferProcedureInput<TProcedure>,
inferTransformedProcedureOutput<TRoot, TProcedure>,
TRPCClientError<TRoot>
>,
) => Promise<void>;
): Promise<void>;
};

/**
Expand Down
56 changes: 28 additions & 28 deletions packages/react-query/src/shared/proxy/utilsProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,25 @@ type DecorateProcedure<
/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientfetchquery
*/
fetch: (
fetch(
input: inferProcedureInput<TProcedure>,
opts?: TRPCFetchQueryOptions<
inferTransformedProcedureOutput<TRoot, TProcedure>,
TRPCClientError<TRoot>
>,
) => Promise<inferTransformedProcedureOutput<TRoot, TProcedure>>;
): Promise<inferTransformedProcedureOutput<TRoot, TProcedure>>;

/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientfetchinfinitequery
*/
fetchInfinite: (
fetchInfinite(
input: inferProcedureInput<TProcedure>,
opts?: TRPCFetchInfiniteQueryOptions<
inferProcedureInput<TProcedure>,
inferTransformedProcedureOutput<TRoot, TProcedure>,
TRPCClientError<TRoot>
>,
) => Promise<
): Promise<
InfiniteData<
inferTransformedProcedureOutput<TRoot, TProcedure>,
NonNullable<ExtractCursorType<inferProcedureInput<TProcedure>>> | null
Expand All @@ -73,41 +73,41 @@ type DecorateProcedure<
/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientprefetchquery
*/
prefetch: (
prefetch(
input: inferProcedureInput<TProcedure>,
opts?: TRPCFetchQueryOptions<
inferTransformedProcedureOutput<TRoot, TProcedure>,
TRPCClientError<TRoot>
>,
) => Promise<void>;
): Promise<void>;

/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientprefetchinfinitequery
*/
prefetchInfinite: (
prefetchInfinite(
input: inferProcedureInput<TProcedure>,
opts?: TRPCFetchInfiniteQueryOptions<
inferProcedureInput<TProcedure>,
inferTransformedProcedureOutput<TRoot, TProcedure>,
TRPCClientError<TRoot>
>,
) => Promise<void>;
): Promise<void>;

/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientensurequerydata
*/
ensureData: (
ensureData(
input: inferProcedureInput<TProcedure>,
opts?: TRPCFetchQueryOptions<
inferTransformedProcedureOutput<TRoot, TProcedure>,
TRPCClientError<TRoot>
>,
) => Promise<inferTransformedProcedureOutput<TRoot, TProcedure>>;
): Promise<inferTransformedProcedureOutput<TRoot, TProcedure>>;

/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientinvalidatequeries
*/
invalidate: (
invalidate(
input?: DeepPartial<inferProcedureInput<TProcedure>>,
filters?: Omit<InvalidateQueryFilters, 'predicate'> & {
predicate?: (
Expand All @@ -125,37 +125,37 @@ type DecorateProcedure<
) => boolean;
},
options?: InvalidateOptions,
) => Promise<void>;
): Promise<void>;

/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientrefetchqueries
*/
refetch: (
refetch(
input?: inferProcedureInput<TProcedure>,
filters?: RefetchQueryFilters,
options?: RefetchOptions,
) => Promise<void>;
): Promise<void>;

/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientcancelqueries
*/
cancel: (
cancel(
input?: inferProcedureInput<TProcedure>,
options?: CancelOptions,
) => Promise<void>;
): Promise<void>;

/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientresetqueries
*/
reset: (
reset(
input?: inferProcedureInput<TProcedure>,
options?: ResetOptions,
) => Promise<void>;
): Promise<void>;

/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientsetquerydata
*/
setData: (
setData(
/**
* The input of the procedure
*/
Expand All @@ -165,12 +165,12 @@ type DecorateProcedure<
inferTransformedProcedureOutput<TRoot, TProcedure> | undefined
>,
options?: SetDataOptions,
) => void;
): void;

/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientsetquerydata
*/
setInfiniteData: (
setInfiniteData(
input: inferProcedureInput<TProcedure>,
updater: Updater<
| InfiniteData<
Expand All @@ -185,21 +185,21 @@ type DecorateProcedure<
| undefined
>,
options?: SetDataOptions,
) => void;
): void;

/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientgetquerydata
*/
getData: (
getData(
input?: inferProcedureInput<TProcedure>,
) => inferTransformedProcedureOutput<TRoot, TProcedure> | undefined;
): inferTransformedProcedureOutput<TRoot, TProcedure> | undefined;

/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientgetquerydata
*/
getInfiniteData: (
getInfiniteData(
input?: inferProcedureInput<TProcedure>,
) =>
):
| InfiniteData<
inferTransformedProcedureOutput<TRoot, TProcedure>,
NonNullable<ExtractCursorType<inferProcedureInput<TProcedure>>> | null
Expand All @@ -217,11 +217,11 @@ type DecorateRouter = {
* @link https://trpc.io/docs/v10/useContext#query-invalidation
* @link https://tanstack.com/query/v5/docs/framework/react/guides/query-invalidation
*/
invalidate: (
invalidate(
input?: undefined,
filters?: InvalidateQueryFilters,
options?: InvalidateOptions,
) => Promise<void>;
): Promise<void>;
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export type FileUploadHandlerOptions = {
* @param contentType
* @param name
*/
filter?: (args: FileUploadHandlerFilterArgs) => Promise<boolean> | boolean;
filter?(args: FileUploadHandlerFilterArgs): Promise<boolean> | boolean;
};

const defaultFilePathResolver: FileUploadHandlerPathResolver = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export type MemoryUploadHandlerOptions = {
* @param mimetype
* @param encoding
*/
filter?: (args: MemoryUploadHandlerFilterArgs) => Promise<boolean> | boolean;
filter?(args: MemoryUploadHandlerFilterArgs): Promise<boolean> | boolean;
};

export function createMemoryUploadHandler({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export type MemoryUploadHandlerOptions = {
* @param mimetype
* @param encoding
*/
filter?: (args: MemoryUploadHandlerFilterArgs) => Promise<boolean> | boolean;
filter?(args: MemoryUploadHandlerFilterArgs): Promise<boolean> | boolean;
};

/**
Expand Down
12 changes: 6 additions & 6 deletions packages/server/src/observable/operators.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ interface SubscriptionEvents<TOutput> {
}

declare interface CustomEventEmitter<TOutput> {
on: <U extends keyof SubscriptionEvents<TOutput>>(
on<U extends keyof SubscriptionEvents<TOutput>>(
event: U,
listener: SubscriptionEvents<TOutput>[U],
) => this;
): this;

once: <U extends keyof SubscriptionEvents<TOutput>>(
once<U extends keyof SubscriptionEvents<TOutput>>(
event: U,
listener: SubscriptionEvents<TOutput>[U],
) => this;
): this;

emit: <U extends keyof SubscriptionEvents<TOutput>>(
emit<U extends keyof SubscriptionEvents<TOutput>>(
event: U,
...args: Parameters<SubscriptionEvents<TOutput>[U]>
) => boolean;
): boolean;
}
class CustomEventEmitter<TOutput>
extends EventEmitter
Expand Down

0 comments on commit 013ca2f

Please sign in to comment.