Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix: add unified-signatures rule (#5120)

LongYinanacf2de813aba
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<Query extends GraphQLQuery>(
- options: QueryOptions<Query>
-): SWRResponse<
- QueryResponse<Query>,
- GraphQLError | GraphQLError[],
- {
- suspense: true;
- }
->;
export function useQuery<Query extends GraphQLQuery>(
options: QueryOptions<Query>,
- config: Omit<
+ config?: Omit<
SWRConfiguration<
QueryResponse<Query>,
GraphQLError | GraphQLError[],
@@ -160,17 +151,9 @@ export function useQueryInfinite<Query extends GraphQLQuery>(
*
* trigger({ name: 'John Doe' })
*/
-export function useMutation<Mutation extends GraphQLQuery, K extends Key = Key>(
- options: Omit<MutationOptions<Mutation>, 'variables'>
-): SWRMutationResponse<
- QueryResponse<Mutation>,
- GraphQLError | GraphQLError[],
- K,
- QueryVariables<Mutation>
->;
export function useMutation<Mutation extends GraphQLQuery, K extends Key = Key>(
options: Omit<MutationOptions<Mutation>, 'variables'>,
- config: Omit<
+ config?: Omit<
SWRMutationConfiguration<
QueryResponse<Mutation>,
GraphQLError | GraphQLError[],