From 275c2430c4fb434c66e1bd1fa664bc8ee2966af1 Mon Sep 17 00:00:00 2001 From: EYHN Date: Fri, 20 Dec 2024 15:40:21 +0800 Subject: [PATCH] dev --- .../src/components/affine/page-history-modal/data.ts | 1 + .../block-suite-editor/specs/custom/spec-patchers.tsx | 6 +----- .../core/src/components/doc-properties/table.tsx | 3 +-- .../src/components/hooks/affine/use-enable-cloud.tsx | 3 ++- .../core/src/components/hooks/use-workspace.ts | 2 +- .../core/src/components/page-detail-editor.tsx | 1 + .../core/src/desktop/pages/workspace/index.tsx | 6 +++--- .../core/src/modules/app-sidebar/views/index.tsx | 1 + .../core/src/modules/cloud/stores/server-list.ts | 2 +- .../core/src/modules/collection/services/collection.ts | 2 +- .../core/src/modules/doc/entities/property-list.ts | 2 +- .../core/src/modules/doc/entities/record-list.ts | 3 +-- .../frontend/core/src/modules/doc/entities/record.ts | 3 +-- .../core/src/modules/doc/stores/doc-properties.ts | 3 +-- .../src/modules/docs-search/services/docs-search.ts | 3 ++- .../modules/editor-setting/services/editor-setting.ts | 3 ++- .../core/src/modules/favorite/services/old/adapter.ts | 1 + .../core/src/modules/feature-flag/entities/flags.ts | 3 +-- .../modules/global-context/entities/global-context.ts | 3 +-- .../core/src/modules/theme/services/edgeless-theme.ts | 3 ++- .../core/src/modules/workspace-engine/impls/cloud.ts | 4 ++-- .../core/src/modules/workspace-engine/impls/local.ts | 2 +- .../core/src/modules/workspace/entities/engine.ts | 10 +++++++--- .../core/src/modules/workspace/entities/list.ts | 3 +-- .../core/src/modules/workspace/entities/profile.ts | 2 +- .../core/src/modules/workspace/entities/workspace.ts | 3 +-- .../core/src/modules/workspace/providers/flavour.ts | 2 +- 27 files changed, 40 insertions(+), 40 deletions(-) diff --git a/packages/frontend/core/src/components/affine/page-history-modal/data.ts b/packages/frontend/core/src/components/affine/page-history-modal/data.ts index 73f80f5ab73eb..e46c04c4e7519 100644 --- a/packages/frontend/core/src/components/affine/page-history-modal/data.ts +++ b/packages/frontend/core/src/components/affine/page-history-modal/data.ts @@ -228,6 +228,7 @@ export function revertUpdate( snapshotStateVector ); const undoManager = new UndoManager( + // oxlint-disable array-callback-return [...snapshotDoc.share.keys()].map(key => { const type = getMetadata(key); if (type === 'Text') { diff --git a/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/spec-patchers.tsx b/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/spec-patchers.tsx index b97f863733eaf..374f633b3bb4b 100644 --- a/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/spec-patchers.tsx +++ b/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/spec-patchers.tsx @@ -8,11 +8,7 @@ import { type useConfirmModal, } from '@affine/component'; import { WorkspaceServerService } from '@affine/core/modules/cloud'; -import { - type DocRecord, - DocService, - DocsService, -} from '@affine/core/modules/doc'; +import { type DocService, DocsService } from '@affine/core/modules/doc'; import type { EditorService } from '@affine/core/modules/editor'; import { EditorSettingService } from '@affine/core/modules/editor-setting'; import { resolveLinkToDoc } from '@affine/core/modules/navigation'; diff --git a/packages/frontend/core/src/components/doc-properties/table.tsx b/packages/frontend/core/src/components/doc-properties/table.tsx index da7180dbc4434..9774aa5d1cec3 100644 --- a/packages/frontend/core/src/components/doc-properties/table.tsx +++ b/packages/frontend/core/src/components/doc-properties/table.tsx @@ -15,8 +15,7 @@ import type { DatabaseRow, DatabaseValueCell, } from '@affine/core/modules/doc-info/types'; -import { WorkbenchService } from '@affine/core/modules/workbench'; -import { ViewService } from '@affine/core/modules/workbench'; +import { ViewService, WorkbenchService } from '@affine/core/modules/workbench'; import type { AffineDNDData } from '@affine/core/types/dnd'; import { useI18n } from '@affine/i18n'; import { track } from '@affine/track'; diff --git a/packages/frontend/core/src/components/hooks/affine/use-enable-cloud.tsx b/packages/frontend/core/src/components/hooks/affine/use-enable-cloud.tsx index d6167fd7373fb..8e11aa3ac09b0 100644 --- a/packages/frontend/core/src/components/hooks/affine/use-enable-cloud.tsx +++ b/packages/frontend/core/src/components/hooks/affine/use-enable-cloud.tsx @@ -1,7 +1,8 @@ import { notify, useConfirmModal } from '@affine/component'; import { AuthService, ServersService } from '@affine/core/modules/cloud'; import { GlobalDialogService } from '@affine/core/modules/dialogs'; -import { Workspace, WorkspacesService } from '@affine/core/modules/workspace'; +import type { Workspace} from '@affine/core/modules/workspace'; +import { WorkspacesService } from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; import { useLiveData, useService } from '@toeverything/infra'; import { useCallback } from 'react'; diff --git a/packages/frontend/core/src/components/hooks/use-workspace.ts b/packages/frontend/core/src/components/hooks/use-workspace.ts index b6de5246dfc0c..5f187368fe12f 100644 --- a/packages/frontend/core/src/components/hooks/use-workspace.ts +++ b/packages/frontend/core/src/components/hooks/use-workspace.ts @@ -1,5 +1,5 @@ import { - Workspace, + type Workspace, type WorkspaceMetadata, WorkspacesService, } from '@affine/core/modules/workspace'; diff --git a/packages/frontend/core/src/components/page-detail-editor.tsx b/packages/frontend/core/src/components/page-detail-editor.tsx index 66ad14a4eb5f0..a50387520bba4 100644 --- a/packages/frontend/core/src/components/page-detail-editor.tsx +++ b/packages/frontend/core/src/components/page-detail-editor.tsx @@ -17,6 +17,7 @@ import { BlockSuiteEditor as Editor } from './blocksuite/block-suite-editor'; import * as styles from './page-detail-editor.css'; declare global { + // oxlint-disable-next-line no-var var currentEditor: AffineEditorContainer | undefined; } diff --git a/packages/frontend/core/src/desktop/pages/workspace/index.tsx b/packages/frontend/core/src/desktop/pages/workspace/index.tsx index 7b7fde0fe33d3..49f3b98f0d4c8 100644 --- a/packages/frontend/core/src/desktop/pages/workspace/index.tsx +++ b/packages/frontend/core/src/desktop/pages/workspace/index.tsx @@ -34,11 +34,11 @@ declare global { /** * @internal debug only */ - + // oxlint-disable-next-line no-var var currentWorkspace: Workspace | undefined; - + // oxlint-disable-next-line no-var var exportWorkspaceSnapshot: (docs?: string[]) => Promise; - + // oxlint-disable-next-line no-var var importWorkspaceSnapshot: () => Promise; interface WindowEventMap { 'affine:workspace:change': CustomEvent<{ id: string }>; diff --git a/packages/frontend/core/src/modules/app-sidebar/views/index.tsx b/packages/frontend/core/src/modules/app-sidebar/views/index.tsx index 8747f457471d4..9c254d74419c1 100644 --- a/packages/frontend/core/src/modules/app-sidebar/views/index.tsx +++ b/packages/frontend/core/src/modules/app-sidebar/views/index.tsx @@ -285,6 +285,7 @@ const RandomBars = ({ count, header }: { count: number; header?: boolean }) => { /> ) : null} {Array.from({ length: count }).map((_, index) => ( + // oxlint-disable-next-line eslint-plugin-react(no-array-index-key) ))} diff --git a/packages/frontend/core/src/modules/cloud/stores/server-list.ts b/packages/frontend/core/src/modules/cloud/stores/server-list.ts index cc393cc75828a..690a2851a6ae9 100644 --- a/packages/frontend/core/src/modules/cloud/stores/server-list.ts +++ b/packages/frontend/core/src/modules/cloud/stores/server-list.ts @@ -1,7 +1,7 @@ import { Store } from '@toeverything/infra'; import { map } from 'rxjs'; -import { GlobalStateService } from '../../storage'; +import type { GlobalStateService } from '../../storage'; import { BUILD_IN_SERVERS } from '../constant'; import type { ServerConfig, ServerMetadata } from '../types'; diff --git a/packages/frontend/core/src/modules/collection/services/collection.ts b/packages/frontend/core/src/modules/collection/services/collection.ts index 3ea3f7642e6a7..de434461f05f4 100644 --- a/packages/frontend/core/src/modules/collection/services/collection.ts +++ b/packages/frontend/core/src/modules/collection/services/collection.ts @@ -7,7 +7,7 @@ import { LiveData, Service } from '@toeverything/infra'; import { Observable } from 'rxjs'; import { Array as YArray } from 'yjs'; -import { WorkspaceService } from '../../workspace'; +import type { WorkspaceService } from '../../workspace'; const SETTING_KEY = 'setting'; diff --git a/packages/frontend/core/src/modules/doc/entities/property-list.ts b/packages/frontend/core/src/modules/doc/entities/property-list.ts index 5b68c7872430a..b7a146bc5d189 100644 --- a/packages/frontend/core/src/modules/doc/entities/property-list.ts +++ b/packages/frontend/core/src/modules/doc/entities/property-list.ts @@ -1,8 +1,8 @@ import { Entity, generateFractionalIndexingKeyBetween, + LiveData, } from '@toeverything/infra'; -import { LiveData } from '@toeverything/infra'; import type { DocCustomPropertyInfo } from '../../db/schema/schema'; import type { DocPropertiesStore } from '../stores/doc-properties'; diff --git a/packages/frontend/core/src/modules/doc/entities/record-list.ts b/packages/frontend/core/src/modules/doc/entities/record-list.ts index 1ca50c97a3083..35001dac84257 100644 --- a/packages/frontend/core/src/modules/doc/entities/record-list.ts +++ b/packages/frontend/core/src/modules/doc/entities/record-list.ts @@ -1,6 +1,5 @@ import type { DocMode } from '@blocksuite/affine/blocks'; -import { Entity } from '@toeverything/infra'; -import { LiveData } from '@toeverything/infra'; +import { Entity, LiveData } from '@toeverything/infra'; import { map } from 'rxjs'; import type { DocsStore } from '../stores/docs'; diff --git a/packages/frontend/core/src/modules/doc/entities/record.ts b/packages/frontend/core/src/modules/doc/entities/record.ts index 1491068959821..50f3f5d6a32b5 100644 --- a/packages/frontend/core/src/modules/doc/entities/record.ts +++ b/packages/frontend/core/src/modules/doc/entities/record.ts @@ -1,7 +1,6 @@ import type { DocMode } from '@blocksuite/affine/blocks'; import type { DocMeta } from '@blocksuite/affine/store'; -import { Entity } from '@toeverything/infra'; -import { LiveData } from '@toeverything/infra'; +import { Entity, LiveData } from '@toeverything/infra'; import type { DocProperties } from '../../db'; import type { DocPropertiesStore } from '../stores/doc-properties'; diff --git a/packages/frontend/core/src/modules/doc/stores/doc-properties.ts b/packages/frontend/core/src/modules/doc/stores/doc-properties.ts index f9180d185cdfb..b94e66a992e93 100644 --- a/packages/frontend/core/src/modules/doc/stores/doc-properties.ts +++ b/packages/frontend/core/src/modules/doc/stores/doc-properties.ts @@ -1,5 +1,4 @@ -import { Store } from '@toeverything/infra'; -import { yjsObserveByPath, yjsObserveDeep } from '@toeverything/infra'; +import { Store, yjsObserveByPath, yjsObserveDeep } from '@toeverything/infra'; import { differenceBy, isNil, omitBy } from 'lodash-es'; import { combineLatest, map, switchMap } from 'rxjs'; import { AbstractType as YAbstractType } from 'yjs'; diff --git a/packages/frontend/core/src/modules/docs-search/services/docs-search.ts b/packages/frontend/core/src/modules/docs-search/services/docs-search.ts index ffb117f47cadb..792e54d410f6b 100644 --- a/packages/frontend/core/src/modules/docs-search/services/docs-search.ts +++ b/packages/frontend/core/src/modules/docs-search/services/docs-search.ts @@ -5,7 +5,8 @@ import { isEmpty, omit } from 'lodash-es'; import { map, type Observable, switchMap } from 'rxjs'; import { z } from 'zod'; -import { WorkspaceEngineBeforeStart, WorkspaceService } from '../../workspace'; +import type { WorkspaceService } from '../../workspace'; +import { WorkspaceEngineBeforeStart } from '../../workspace'; import { DocsIndexer } from '../entities/docs-indexer'; @OnEvent(WorkspaceEngineBeforeStart, s => s.handleWorkspaceEngineBeforeStart) diff --git a/packages/frontend/core/src/modules/editor-setting/services/editor-setting.ts b/packages/frontend/core/src/modules/editor-setting/services/editor-setting.ts index 93a1d339bf5c1..b455e0c738ca5 100644 --- a/packages/frontend/core/src/modules/editor-setting/services/editor-setting.ts +++ b/packages/frontend/core/src/modules/editor-setting/services/editor-setting.ts @@ -1,7 +1,8 @@ import { OnEvent, Service } from '@toeverything/infra'; import { DocsService } from '../../doc'; -import { Workspace, WorkspaceInitialized } from '../../workspace'; +import type { Workspace} from '../../workspace'; +import { WorkspaceInitialized } from '../../workspace'; import { EditorSetting, type EditorSettingExt, diff --git a/packages/frontend/core/src/modules/favorite/services/old/adapter.ts b/packages/frontend/core/src/modules/favorite/services/old/adapter.ts index fd3881cf9d38f..3bcf5fcc63d28 100644 --- a/packages/frontend/core/src/modules/favorite/services/old/adapter.ts +++ b/packages/frontend/core/src/modules/favorite/services/old/adapter.ts @@ -154,6 +154,7 @@ class WorkspacePropertiesAdapter { setJournalPageDateString(id: string, date: string) { this.ensurePageProperties(id); const pageProperties = this.pageProperties?.[id]; + // oxlint-disable-next-line no-non-null-assertion pageProperties!.system[PageSystemPropertyId.Journal].value = date; } diff --git a/packages/frontend/core/src/modules/feature-flag/entities/flags.ts b/packages/frontend/core/src/modules/feature-flag/entities/flags.ts index 99ea12f220bfa..8d6e71da83ef5 100644 --- a/packages/frontend/core/src/modules/feature-flag/entities/flags.ts +++ b/packages/frontend/core/src/modules/feature-flag/entities/flags.ts @@ -1,5 +1,4 @@ -import { Entity } from '@toeverything/infra'; -import { LiveData } from '@toeverything/infra'; +import { Entity, LiveData } from '@toeverything/infra'; import { NEVER } from 'rxjs'; import type { GlobalStateService } from '../../storage'; diff --git a/packages/frontend/core/src/modules/global-context/entities/global-context.ts b/packages/frontend/core/src/modules/global-context/entities/global-context.ts index dc3bf2b9fda8e..a589a3b789a1c 100644 --- a/packages/frontend/core/src/modules/global-context/entities/global-context.ts +++ b/packages/frontend/core/src/modules/global-context/entities/global-context.ts @@ -1,6 +1,5 @@ import type { DocMode } from '@blocksuite/affine/blocks'; -import { Entity, MemoryMemento } from '@toeverything/infra'; -import { LiveData } from '@toeverything/infra'; +import { Entity, LiveData, MemoryMemento } from '@toeverything/infra'; export class GlobalContext extends Entity { memento = new MemoryMemento(); diff --git a/packages/frontend/core/src/modules/theme/services/edgeless-theme.ts b/packages/frontend/core/src/modules/theme/services/edgeless-theme.ts index 9165f719a21d2..ac3506e6255c4 100644 --- a/packages/frontend/core/src/modules/theme/services/edgeless-theme.ts +++ b/packages/frontend/core/src/modules/theme/services/edgeless-theme.ts @@ -1,6 +1,7 @@ import { OnEvent, Service } from '@toeverything/infra'; -import { DocCreated, DocRecord } from '../../doc'; +import type { DocRecord } from '../../doc'; +import { DocCreated } from '../../doc'; import type { EditorSettingService } from '../../editor-setting'; import type { EdgelessDefaultTheme } from '../../editor-setting/schema'; import type { AppThemeService } from './theme'; diff --git a/packages/frontend/core/src/modules/workspace-engine/impls/cloud.ts b/packages/frontend/core/src/modules/workspace-engine/impls/cloud.ts index 44a1ef5c32492..f047a31bb488c 100644 --- a/packages/frontend/core/src/modules/workspace-engine/impls/cloud.ts +++ b/packages/frontend/core/src/modules/workspace-engine/impls/cloud.ts @@ -36,10 +36,10 @@ import { import type { GlobalState } from '../../storage'; import { getAFFiNEWorkspaceSchema, - Workspace, + type Workspace, type WorkspaceEngineProvider, type WorkspaceFlavourProvider, - WorkspaceFlavoursProvider, + type WorkspaceFlavoursProvider, type WorkspaceMetadata, type WorkspaceProfileInfo, } from '../../workspace'; diff --git a/packages/frontend/core/src/modules/workspace-engine/impls/local.ts b/packages/frontend/core/src/modules/workspace-engine/impls/local.ts index 26e898e4389eb..45c60b0f201a1 100644 --- a/packages/frontend/core/src/modules/workspace-engine/impls/local.ts +++ b/packages/frontend/core/src/modules/workspace-engine/impls/local.ts @@ -16,7 +16,7 @@ import { getAFFiNEWorkspaceSchema, type WorkspaceEngineProvider, type WorkspaceFlavourProvider, - WorkspaceFlavoursProvider, + type WorkspaceFlavoursProvider, type WorkspaceMetadata, type WorkspaceProfileInfo, } from '../../workspace'; diff --git a/packages/frontend/core/src/modules/workspace/entities/engine.ts b/packages/frontend/core/src/modules/workspace/entities/engine.ts index eb7fa31e3fdec..8433cf6c57e58 100644 --- a/packages/frontend/core/src/modules/workspace/entities/engine.ts +++ b/packages/frontend/core/src/modules/workspace/entities/engine.ts @@ -1,6 +1,10 @@ -import { Entity } from '@toeverything/infra'; -import { AwarenessEngine, BlobEngine, DocEngine } from '@toeverything/infra'; -import { throwIfAborted } from '@toeverything/infra'; +import { + AwarenessEngine, + BlobEngine, + DocEngine, + Entity, + throwIfAborted, +} from '@toeverything/infra'; import type { Doc as YDoc } from 'yjs'; import { WorkspaceEngineBeforeStart } from '../events'; diff --git a/packages/frontend/core/src/modules/workspace/entities/list.ts b/packages/frontend/core/src/modules/workspace/entities/list.ts index 95d21a7df8a9b..8d0384515a020 100644 --- a/packages/frontend/core/src/modules/workspace/entities/list.ts +++ b/packages/frontend/core/src/modules/workspace/entities/list.ts @@ -1,5 +1,4 @@ -import { Entity } from '@toeverything/infra'; -import { LiveData } from '@toeverything/infra'; +import { Entity, LiveData } from '@toeverything/infra'; import { combineLatest, map, of, switchMap } from 'rxjs'; import type { WorkspaceMetadata } from '../metadata'; diff --git a/packages/frontend/core/src/modules/workspace/entities/profile.ts b/packages/frontend/core/src/modules/workspace/entities/profile.ts index 5871df95b476c..e621055fa18ab 100644 --- a/packages/frontend/core/src/modules/workspace/entities/profile.ts +++ b/packages/frontend/core/src/modules/workspace/entities/profile.ts @@ -1,7 +1,7 @@ import { DebugLogger } from '@affine/debug'; -import { Entity } from '@toeverything/infra'; import { effect, + Entity, fromPromise, LiveData, onComplete, diff --git a/packages/frontend/core/src/modules/workspace/entities/workspace.ts b/packages/frontend/core/src/modules/workspace/entities/workspace.ts index dda010e059f00..12d83e689bc6a 100644 --- a/packages/frontend/core/src/modules/workspace/entities/workspace.ts +++ b/packages/frontend/core/src/modules/workspace/entities/workspace.ts @@ -1,6 +1,5 @@ import { DocCollection } from '@blocksuite/affine/store'; -import { Entity } from '@toeverything/infra'; -import { LiveData } from '@toeverything/infra'; +import { Entity, LiveData } from '@toeverything/infra'; import { nanoid } from 'nanoid'; import { Observable } from 'rxjs'; import type { Awareness } from 'y-protocols/awareness.js'; diff --git a/packages/frontend/core/src/modules/workspace/providers/flavour.ts b/packages/frontend/core/src/modules/workspace/providers/flavour.ts index f67387cad3aba..c194aaee4ab73 100644 --- a/packages/frontend/core/src/modules/workspace/providers/flavour.ts +++ b/packages/frontend/core/src/modules/workspace/providers/flavour.ts @@ -1,11 +1,11 @@ import type { DocCollection } from '@blocksuite/affine/store'; -import type { LiveData } from '@toeverything/infra'; import { type AwarenessConnection, type BlobStorage, createIdentifier, type DocServer, type DocStorage, + type LiveData, } from '@toeverything/infra'; import type { WorkspaceProfileInfo } from '../entities/profile';