style: enable import-x/no-duplicates (#6279)

This commit is contained in:
EYHN
2024-03-25 03:55:32 +00:00
parent 7ce2bfbf0b
commit f2adbdaba4
342 changed files with 881 additions and 1033 deletions

View File

@@ -1,8 +1,8 @@
import { DebugLogger } from '@affine/debug';
import type { AwarenessProvider } from '@toeverything/infra';
import type { Awareness } from 'y-protocols/awareness';
import {
applyAwarenessUpdate,
type Awareness,
encodeAwarenessUpdate,
removeAwarenessStates,
} from 'y-protocols/awareness';

View File

@@ -1,13 +1,14 @@
import {
deleteBlobMutation,
fetcher,
fetchWithTraceReport,
findGraphQLError,
getBaseUrl,
listBlobsQuery,
setBlobMutation,
} from '@affine/graphql';
import { fetcher } from '@affine/graphql';
import { type BlobStorage, BlobStorageOverCapacity } from '@toeverything/infra';
import type { BlobStorage } from '@toeverything/infra';
import { BlobStorageOverCapacity } from '@toeverything/infra';
import { bufferToBlob } from '../utils/buffer-to-blob';

View File

@@ -1,5 +1,6 @@
import { DebugLogger } from '@affine/debug';
import { type DocServer, throwIfAborted } from '@toeverything/infra';
import type { DocServer } from '@toeverything/infra';
import { throwIfAborted } from '@toeverything/infra';
import type { Socket } from 'socket.io-client';
import { getIoManager } from '../utils/affine-io';

View File

@@ -2,16 +2,16 @@ import { WorkspaceFlavour } from '@affine/env/workspace';
import {
createWorkspaceMutation,
deleteWorkspaceMutation,
fetcher,
findGraphQLError,
getWorkspacesQuery,
} from '@affine/graphql';
import { fetcher } from '@affine/graphql';
import { DocCollection } from '@blocksuite/store';
import type { WorkspaceListProvider } from '@toeverything/infra';
import {
type BlobStorage,
type WorkspaceInfo,
type WorkspaceMetadata,
import type {
BlobStorage,
WorkspaceInfo,
WorkspaceListProvider,
WorkspaceMetadata,
} from '@toeverything/infra';
import { globalBlockSuiteSchema } from '@toeverything/infra';
import { difference } from 'lodash-es';

View File

@@ -1,6 +1,5 @@
import { WorkspaceFlavour } from '@affine/env/workspace';
import type { WorkspaceFactory } from '@toeverything/infra';
import type { ServiceCollection } from '@toeverything/infra';
import type { ServiceCollection, WorkspaceFactory } from '@toeverything/infra';
import {
AwarenessContext,
AwarenessProvider,

View File

@@ -1,10 +1,10 @@
import {
type GlobalState,
type Memento,
type Workspace,
type WorkspaceLocalState,
wrapMemento,
import type {
GlobalState,
Memento,
Workspace,
WorkspaceLocalState,
} from '@toeverything/infra';
import { wrapMemento } from '@toeverything/infra';
export class WorkspaceLocalStateImpl implements WorkspaceLocalState {
wrapped: Memento;

View File

@@ -1,4 +1,4 @@
import { type BlobStorage } from '@toeverything/infra';
import type { BlobStorage } from '@toeverything/infra';
import { createStore, del, get, keys, set } from 'idb-keyval';
import { bufferToBlob } from '../utils/buffer-to-blob';

View File

@@ -1,6 +1,6 @@
import { apis } from '@affine/electron-api';
import { assertExists } from '@blocksuite/global/utils';
import { type BlobStorage } from '@toeverything/infra';
import type { BlobStorage } from '@toeverything/infra';
import { bufferToBlob } from '../utils/buffer-to-blob';

View File

@@ -1,4 +1,4 @@
import { type BlobStorage } from '@toeverything/infra';
import type { BlobStorage } from '@toeverything/infra';
export const predefinedStaticFiles = [
'029uztLz2CzJezK7UUhrbGiWUdZ0J7NVs_qR6RDsvb8=',

View File

@@ -1,10 +1,6 @@
import type { ByteKV, ByteKVBehavior, DocStorage } from '@toeverything/infra';
import {
type DBSchema,
type IDBPDatabase,
type IDBPObjectStore,
openDB,
} from 'idb';
import type { DBSchema, IDBPDatabase, IDBPObjectStore } from 'idb';
import { openDB } from 'idb';
import { mergeUpdates } from 'yjs';
import { BroadcastChannelDocEventBus } from './doc-broadcast-channel';

View File

@@ -1,17 +1,8 @@
import { apis } from '@affine/electron-api';
import {
AsyncLock,
type ByteKV,
type ByteKVBehavior,
type DocStorage,
MemoryDocEventBus,
} from '@toeverything/infra';
import {
type DBSchema,
type IDBPDatabase,
type IDBPObjectStore,
openDB,
} from 'idb';
import type { ByteKV, ByteKVBehavior, DocStorage } from '@toeverything/infra';
import { AsyncLock, MemoryDocEventBus } from '@toeverything/infra';
import type { DBSchema, IDBPDatabase, IDBPObjectStore } from 'idb';
import { openDB } from 'idb';
export class SqliteDocStorage implements DocStorage {
constructor(private readonly workspaceId: string) {}

View File

@@ -1,11 +1,11 @@
import { apis } from '@affine/electron-api';
import { WorkspaceFlavour } from '@affine/env/workspace';
import { DocCollection } from '@blocksuite/store';
import type { WorkspaceListProvider } from '@toeverything/infra';
import {
type BlobStorage,
type WorkspaceInfo,
type WorkspaceMetadata,
import type {
BlobStorage,
WorkspaceInfo,
WorkspaceListProvider,
WorkspaceMetadata,
} from '@toeverything/infra';
import { globalBlockSuiteSchema } from '@toeverything/infra';
import { difference } from 'lodash-es';