Skip to content

Commit fb53233

Browse files
committed
fix lint
1 parent db243c6 commit fb53233

File tree

1 file changed

+7
-12
lines changed
  • packages/openapi-react-query/src

1 file changed

+7
-12
lines changed

packages/openapi-react-query/src/index.ts

+7-12
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
type DataTag,
1616
useMutation,
1717
useQuery,
18-
useSuspenseQuery,
18+
useSuspenseQuery,
1919
dataTagSymbol,
2020
dataTagErrorSymbol,
2121
} from "@tanstack/react-query";
@@ -39,10 +39,10 @@ export type QueryKey<
3939
Path extends PathsWithMethod<Paths, Method>,
4040
Media extends MediaType,
4141
Init extends MaybeOptionalInit<Paths[Path], Method> = MaybeOptionalInit<Paths[Path], Method>,
42-
Response extends Required<FetchResponse<Paths[Path][Method], Init, Media>> = Required<
43-
FetchResponse<Paths[Path][Method], Init, Media>
44-
>,
45-
> = DataTag<readonly [Method, Path, Init], Response["data"]>
42+
Response extends Required<FetchResponse<Paths[Path][Method], Init, Media>> = Required<
43+
FetchResponse<Paths[Path][Method], Init, Media>
44+
>,
45+
> = DataTag<readonly [Method, Path, Init], Response["data"]>;
4646

4747
export type QueryOptionsFunction<Paths extends Record<string, Record<HttpMethod, {}>>, Media extends MediaType> = <
4848
Method extends HttpMethod,
@@ -207,15 +207,10 @@ export default function createClient<Paths extends {}, Media extends MediaType =
207207
};
208208

209209
const queryOptions: QueryOptionsFunction<Paths, Media> = (method, path, ...[init, options]) => ({
210-
queryKey: Object.assign(init === undefined ? [method, path] as const : [method, path, init] as const, {
210+
queryKey: Object.assign(init === undefined ? ([method, path] as const) : ([method, path, init] as const), {
211211
[dataTagSymbol]: {} as any,
212212
[dataTagErrorSymbol]: {} as any,
213-
}) as QueryKey<
214-
Paths,
215-
typeof method,
216-
typeof path,
217-
Media
218-
>,
213+
}) as QueryKey<Paths, typeof method, typeof path, Media>,
219214
queryFn,
220215
...options,
221216
});

0 commit comments

Comments
 (0)