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
@@ -1,5 +1,5 @@
import type { ServiceProvider } from '@toeverything/infra';
import {
type ServiceProvider,
ServiceProviderContext,
useLiveData,
useService,
@@ -1,10 +1,5 @@
import {
type DateCell,
DatePicker,
IconButton,
Menu,
Scrollable,
} from '@affine/component';
import type { DateCell } from '@affine/component';
import { DatePicker, IconButton, Menu, Scrollable } from '@affine/component';
import { MoveToTrash } from '@affine/core/components/page-list';
import { useTrashModalHelper } from '@affine/core/hooks/affine/use-trash-modal-helper';
import {
@@ -25,9 +20,9 @@ import {
Doc,
PageRecordList,
useLiveData,
useService,
Workspace,
} from '@toeverything/infra';
import { useService } from '@toeverything/infra';
import { assignInlineVars } from '@vanilla-extract/dynamic';
import clsx from 'clsx';
import dayjs from 'dayjs';
@@ -1,8 +1,7 @@
import { IconButton, Tooltip } from '@affine/component';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { ArrowLeftSmallIcon, ArrowRightSmallIcon } from '@blocksuite/icons';
import { useService } from '@toeverything/infra';
import { useLiveData } from '@toeverything/infra';
import { useLiveData, useService } from '@toeverything/infra';
import { useCallback, useEffect, useMemo } from 'react';
import { useGeneralShortcuts } from '../../../hooks/affine/use-shortcuts';
@@ -1,8 +1,8 @@
import {
PreconditionStrategy,
registerAffineCommand,
useService,
} from '@toeverything/infra';
import { useService } from '@toeverything/infra';
import { useEffect } from 'react';
import { Navigator } from '../entities/navigator';
@@ -1,8 +1,6 @@
import { ResizePanel } from '@affine/component/resize-panel';
import { appSidebarOpenAtom } from '@affine/core/components/app-sidebar';
import { appSettingAtom } from '@toeverything/infra';
import { useService } from '@toeverything/infra';
import { useLiveData } from '@toeverything/infra';
import { appSettingAtom, useLiveData, useService } from '@toeverything/infra';
import { useAtomValue } from 'jotai';
import { useCallback, useEffect, useState } from 'react';
@@ -1,8 +1,8 @@
import type { ServiceCollection } from '@toeverything/infra';
import {
GlobalCache,
GlobalState,
PageRecordList,
type ServiceCollection,
Workspace,
WorkspaceScope,
} from '@toeverything/infra';
@@ -1,5 +1,6 @@
import type { Tag as TagSchema } from '@affine/env/filter';
import { LiveData, type PageRecordList } from '@toeverything/infra';
import type { PageRecordList } from '@toeverything/infra';
import { LiveData } from '@toeverything/infra';
import type { WorkspaceLegacyProperties } from '../../workspace';
@@ -1,4 +1,5 @@
import { LiveData, type PageRecordList } from '@toeverything/infra';
import type { PageRecordList } from '@toeverything/infra';
import { LiveData } from '@toeverything/infra';
import { nanoid } from 'nanoid';
import type { WorkspaceLegacyProperties } from '../../workspace';
@@ -1,5 +1,5 @@
import { useLiveData } from '@toeverything/infra';
import { type Location } from 'history';
import type { Location } from 'history';
import { useEffect } from 'react';
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
import { useLocation, useNavigate } from 'react-router-dom';
@@ -1,4 +1,4 @@
import { type Location } from 'history';
import type { Location } from 'history';
import { useEffect } from 'react';
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
import { useLocation } from 'react-router-dom';
@@ -1,8 +1,7 @@
import { IconButton } from '@affine/component';
import { WindowsAppControls } from '@affine/core/components/pure/header/windows-app-controls';
import { RightSidebarIcon } from '@blocksuite/icons';
import { useLiveData } from '@toeverything/infra';
import { useService } from '@toeverything/infra';
import { useLiveData, useService } from '@toeverything/infra';
import { useAtomValue } from 'jotai';
import { Suspense, useCallback } from 'react';
@@ -1,14 +1,8 @@
import { Menu, type MenuProps } from '@affine/component';
import type { MenuProps } from '@affine/component';
import { Menu } from '@affine/component';
import clsx from 'clsx';
import {
forwardRef,
type HTMLAttributes,
memo,
type MouseEventHandler,
useCallback,
useMemo,
useState,
} from 'react';
import type { HTMLAttributes, MouseEventHandler } from 'react';
import { forwardRef, memo, useCallback, useMemo, useState } from 'react';
import * as styles from './indicator.css';
@@ -7,22 +7,16 @@ import {
SoloViewIcon,
} from '@blocksuite/icons';
import { useSortable } from '@dnd-kit/sortable';
import { useService } from '@toeverything/infra';
import { useLiveData } from '@toeverything/infra';
import { useLiveData, useService } from '@toeverything/infra';
import { assignInlineVars } from '@vanilla-extract/dynamic';
import type { SetStateAction } from 'jotai';
import {
type Dispatch,
type HTMLAttributes,
memo,
type PropsWithChildren,
type RefObject,
useCallback,
useEffect,
useMemo,
useRef,
useState,
import type {
Dispatch,
HTMLAttributes,
PropsWithChildren,
RefObject,
} from 'react';
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import type { View } from '../../entities/view';
import { Workbench } from '../../entities/workbench';
@@ -1,4 +1,5 @@
import { type HTMLAttributes, useCallback } from 'react';
import type { HTMLAttributes } from 'react';
import { useCallback } from 'react';
import * as styles from './split-view.css';
@@ -1,8 +1,8 @@
import { useAppSettingHelper } from '@affine/core/hooks/affine/use-app-setting-helper';
import type { DragEndEvent } from '@dnd-kit/core';
import {
closestCenter,
DndContext,
type DragEndEvent,
PointerSensor,
useSensor,
useSensors,
@@ -13,13 +13,8 @@ import {
} from '@dnd-kit/sortable';
import { useService } from '@toeverything/infra';
import clsx from 'clsx';
import {
type HTMLAttributes,
type RefObject,
useCallback,
useRef,
useState,
} from 'react';
import type { HTMLAttributes, RefObject } from 'react';
import { useCallback, useRef, useState } from 'react';
import { createPortal } from 'react-dom';
import type { View } from '../../entities/view';
@@ -1,5 +1,4 @@
import { useService } from '@toeverything/infra';
import { useLiveData } from '@toeverything/infra';
import { useLiveData, useService } from '@toeverything/infra';
import { Workbench } from '../entities/workbench';
import { useView } from './use-view';
@@ -1,6 +1,5 @@
import { useAppSettingHelper } from '@affine/core/hooks/affine/use-app-setting-helper';
import { useService } from '@toeverything/infra';
import { useLiveData } from '@toeverything/infra';
import { useLiveData, useService } from '@toeverything/infra';
import type { To } from 'history';
import { useCallback } from 'react';
@@ -1,5 +1,4 @@
import { useService } from '@toeverything/infra';
import { useLiveData } from '@toeverything/infra';
import { useLiveData, useService } from '@toeverything/infra';
import { useCallback, useEffect, useRef } from 'react';
import { useLocation } from 'react-router-dom';
@@ -1,16 +1,16 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
// the adapter is to bridge the workspace rootdoc & native js bindings
import { createYProxy, type Y } from '@blocksuite/store';
import type { Y } from '@blocksuite/store';
import { createYProxy } from '@blocksuite/store';
import type { Workspace } from '@toeverything/infra';
import { defaultsDeep } from 'lodash-es';
import {
PagePropertyType,
PageSystemPropertyId,
type WorkspaceAffineProperties,
type WorkspaceFavoriteItem,
import type {
WorkspaceAffineProperties,
WorkspaceFavoriteItem,
} from './schema';
import { PagePropertyType, PageSystemPropertyId } from './schema';
const AFFINE_PROPERTIES_ID = 'affine:workspace-properties';