mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
style: enable import-x/no-duplicates (#6279)
This commit is contained in:
@@ -5,12 +5,14 @@ import 'fake-indexeddb/auto';
|
||||
|
||||
import { WorkspacePropertiesAdapter } from '@affine/core/modules/workspace';
|
||||
import { render } from '@testing-library/react';
|
||||
import { Workspace } from '@toeverything/infra';
|
||||
import { ServiceProviderContext, useService } from '@toeverything/infra';
|
||||
import {
|
||||
ServiceProviderContext,
|
||||
useService,
|
||||
Workspace,
|
||||
} from '@toeverything/infra';
|
||||
import { createStore, Provider } from 'jotai';
|
||||
import { Suspense } from 'react';
|
||||
import { describe, expect, test, vi } from 'vitest';
|
||||
import { beforeEach } from 'vitest';
|
||||
import { beforeEach, describe, expect, test, vi } from 'vitest';
|
||||
|
||||
import { configureTestingEnvironment } from '../../testing';
|
||||
import { useDocCollectionPageTitle } from '../use-block-suite-workspace-page-title';
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
import { toast } from '@affine/component';
|
||||
import {
|
||||
type AllPageListConfig,
|
||||
FavoriteTag,
|
||||
} from '@affine/core/components/page-list';
|
||||
import type { AllPageListConfig } from '@affine/core/components/page-list';
|
||||
import { FavoriteTag } from '@affine/core/components/page-list';
|
||||
import { useBlockSuiteDocMeta } from '@affine/core/hooks/use-block-suite-page-meta';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import type { DocMeta } from '@blocksuite/store';
|
||||
import { Workspace } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useService, Workspace } from '@toeverything/infra';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
|
||||
import { usePageHelper } from '../../components/blocksuite/block-suite-page-list/utils';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { type AppSetting, appSettingAtom } from '@toeverything/infra';
|
||||
import type { AppSetting } from '@toeverything/infra';
|
||||
import { appSettingAtom } from '@toeverything/infra';
|
||||
import { useAtom } from 'jotai';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
|
||||
|
||||
@@ -5,12 +5,8 @@ import {
|
||||
import { pushNotificationAtom } from '@affine/component/notification-center';
|
||||
import { apis } from '@affine/electron-api';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import type { PageRootService } from '@blocksuite/blocks';
|
||||
import {
|
||||
HtmlTransformer,
|
||||
MarkdownTransformer,
|
||||
type RootBlockModel,
|
||||
} from '@blocksuite/blocks';
|
||||
import type { PageRootService, RootBlockModel } from '@blocksuite/blocks';
|
||||
import { HtmlTransformer, MarkdownTransformer } from '@blocksuite/blocks';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { nanoid } from 'nanoid';
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import {
|
||||
type GetMembersByWorkspaceIdQuery,
|
||||
getMembersByWorkspaceIdQuery,
|
||||
Permission,
|
||||
} from '@affine/graphql';
|
||||
import type { GetMembersByWorkspaceIdQuery } from '@affine/graphql';
|
||||
import { getMembersByWorkspaceIdQuery, Permission } from '@affine/graphql';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { useQuery } from '../use-query';
|
||||
|
||||
@@ -4,12 +4,14 @@ import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import { EdgelessIcon, HistoryIcon, PageIcon } from '@blocksuite/icons';
|
||||
import { Doc, useLiveData, Workspace } from '@toeverything/infra';
|
||||
import {
|
||||
Doc,
|
||||
PreconditionStrategy,
|
||||
registerAffineCommand,
|
||||
useLiveData,
|
||||
useService,
|
||||
Workspace,
|
||||
} from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { useCallback, useEffect } from 'react';
|
||||
|
||||
|
||||
@@ -3,8 +3,7 @@ import type { DraggableTitleCellData } from '@affine/core/components/page-list';
|
||||
import { useDocMetaHelper } from '@affine/core/hooks/use-block-suite-page-meta';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import type { DragEndEvent, UniqueIdentifier } from '@dnd-kit/core';
|
||||
import { Workspace } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useService, Workspace } from '@toeverything/infra';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import { useBlockSuiteMetaHelper } from './use-block-suite-meta-helper';
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
import { apis } from '@affine/electron-api';
|
||||
import { setupGlobal } from '@affine/env/global';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import {
|
||||
type AppConfigSchema,
|
||||
AppConfigStorage,
|
||||
defaultAppConfig,
|
||||
} from '@toeverything/infra';
|
||||
import { type Dispatch, useEffect, useState } from 'react';
|
||||
import { useMemo } from 'react';
|
||||
import type { AppConfigSchema } from '@toeverything/infra';
|
||||
import { AppConfigStorage, defaultAppConfig } from '@toeverything/infra';
|
||||
import type { Dispatch } from 'react';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
|
||||
/**
|
||||
* Helper class to get/set app config from main process
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { apis, events, type UpdateMeta } from '@affine/electron-api';
|
||||
import type { UpdateMeta } from '@affine/electron-api';
|
||||
import { apis, events } from '@affine/electron-api';
|
||||
import { isBrowser } from '@affine/env/constant';
|
||||
import { appSettingAtom } from '@toeverything/infra';
|
||||
import { atom, useAtom, useAtomValue } from 'jotai';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { AffineEditorContainer } from '@blocksuite/presets';
|
||||
import { atom, type SetStateAction, useAtom } from 'jotai';
|
||||
import type { SetStateAction } from 'jotai';
|
||||
import { atom, useAtom } from 'jotai';
|
||||
|
||||
const activeEditorContainerAtom = atom<AffineEditorContainer | null>(null);
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { Doc, DocCollection } from '@blocksuite/store';
|
||||
import { type Atom, atom, useAtomValue } from 'jotai';
|
||||
import type { Atom } from 'jotai';
|
||||
import { atom, useAtomValue } from 'jotai';
|
||||
|
||||
import { useDocCollectionPage } from './use-block-suite-workspace-page';
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { Doc, DocCollection } from '@blocksuite/store';
|
||||
import { type Atom, atom, useAtomValue } from 'jotai';
|
||||
import type { Atom } from 'jotai';
|
||||
import { atom, useAtomValue } from 'jotai';
|
||||
|
||||
import { useDocCollectionPage } from './use-block-suite-workspace-page';
|
||||
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
import type { WorkspaceSubPath } from '@affine/core/shared';
|
||||
import { createContext, useCallback, useContext, useMemo } from 'react';
|
||||
import {
|
||||
type NavigateFunction,
|
||||
type NavigateOptions,
|
||||
type To,
|
||||
useLocation,
|
||||
} from 'react-router-dom';
|
||||
import type { NavigateFunction, NavigateOptions, To } from 'react-router-dom';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
|
||||
import { router } from '../router';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { Workspace } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useService, Workspace } from '@toeverything/infra';
|
||||
import { useStore } from 'jotai';
|
||||
import { useTheme } from 'next-themes';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
||||
import { type SubscriptionQuery, subscriptionQuery } from '@affine/graphql';
|
||||
import type { SubscriptionQuery } from '@affine/graphql';
|
||||
import { subscriptionQuery } from '@affine/graphql';
|
||||
|
||||
import { useServerFeatures } from './affine/use-server-config';
|
||||
import { useQuery } from './use-query';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { WorkspaceMetadata } from '@toeverything/infra';
|
||||
import { WorkspaceManager } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useService, WorkspaceManager } from '@toeverything/infra';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
export function useWorkspaceBlobObjectUrl(
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
enabledFeaturesQuery,
|
||||
setWorkspaceExperimentalFeatureMutation,
|
||||
} from '@affine/graphql';
|
||||
import { type WorkspaceMetadata } from '@toeverything/infra';
|
||||
import type { WorkspaceMetadata } from '@toeverything/infra';
|
||||
|
||||
import { useAsyncCallback } from './affine-async-hooks';
|
||||
import { useMutateQueryResource, useMutation } from './use-mutation';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { WorkspaceManager, type WorkspaceMetadata } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import type { WorkspaceMetadata } from '@toeverything/infra';
|
||||
import { useService, WorkspaceManager } from '@toeverything/infra';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import { useWorkspaceBlobObjectUrl } from './use-workspace-blob';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { WorkspaceMetadata } from '@toeverything/infra';
|
||||
import { type Workspace, WorkspaceManager } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import type { Workspace, WorkspaceMetadata } from '@toeverything/infra';
|
||||
import { useService, WorkspaceManager } from '@toeverything/infra';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user