From acf2de813aba7d79b264988a99dc4410ccfe80f8 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Wed, 29 Nov 2023 04:44:17 +0000 Subject: [PATCH] fix: add unified-signatures rule (#5120) --- .eslintrc.js | 1 + packages/frontend/workspace/src/affine/gql.ts | 21 ++----------------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 5b4ec4b310..16302e62b9 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -136,6 +136,7 @@ const config = { '@typescript-eslint/no-empty-function': 'off', '@typescript-eslint/await-thenable': 'error', '@typescript-eslint/require-array-sort-compare': 'error', + '@typescript-eslint/unified-signatures': 'error', '@typescript-eslint/no-unused-vars': [ 'error', { diff --git a/packages/frontend/workspace/src/affine/gql.ts b/packages/frontend/workspace/src/affine/gql.ts index b7988042a0..36f02c4eca 100644 --- a/packages/frontend/workspace/src/affine/gql.ts +++ b/packages/frontend/workspace/src/affine/gql.ts @@ -44,18 +44,9 @@ export const fetcher = gqlFetcherFactory( * }) * ``` */ -export function useQuery( - options: QueryOptions -): SWRResponse< - QueryResponse, - GraphQLError | GraphQLError[], - { - suspense: true; - } ->; export function useQuery( options: QueryOptions, - config: Omit< + config?: Omit< SWRConfiguration< QueryResponse, GraphQLError | GraphQLError[], @@ -160,17 +151,9 @@ export function useQueryInfinite( * * trigger({ name: 'John Doe' }) */ -export function useMutation( - options: Omit, 'variables'> -): SWRMutationResponse< - QueryResponse, - GraphQLError | GraphQLError[], - K, - QueryVariables ->; export function useMutation( options: Omit, 'variables'>, - config: Omit< + config?: Omit< SWRMutationConfiguration< QueryResponse, GraphQLError | GraphQLError[],