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

@@ -11,7 +11,8 @@ import {
waitForEditorLoad,
} from '@affine-test/kit/utils/page-logic';
import { createLocalWorkspace } from '@affine-test/kit/utils/workspace';
import { expect, type Page } from '@playwright/test';
import type { Page } from '@playwright/test';
import { expect } from '@playwright/test';
let user: {
id: string;

View File

@@ -10,7 +10,8 @@ import {
clickSideBarCurrentWorkspaceBanner,
clickSideBarSettingButton,
} from '@affine-test/kit/utils/sidebar';
import { expect, type Page } from '@playwright/test';
import type { Page } from '@playwright/test';
import { expect } from '@playwright/test';
const historyShortcut = async (page: Page, command: 'goBack' | 'goForward') => {
await withCtrlOrMeta(page, () =>

View File

@@ -7,7 +7,8 @@ import {
waitForEditorLoad,
} from '@affine-test/kit/utils/page-logic';
import { clickSideBarAllPageButton } from '@affine-test/kit/utils/sidebar';
import { expect, type Locator, type Page } from '@playwright/test';
import type { Locator, Page } from '@playwright/test';
import { expect } from '@playwright/test';
const dragToFavourites = async (
page: Page,

View File

@@ -9,7 +9,8 @@ import {
getBlockSuiteEditorTitle,
waitForEditorLoad,
} from '@affine-test/kit/utils/page-logic';
import { expect, type Page } from '@playwright/test';
import type { Page } from '@playwright/test';
import { expect } from '@playwright/test';
async function importImage(page: Page, url: string) {
await focusInlineEditor(page);

View File

@@ -1,8 +1,10 @@
import { test } from '@affine-test/kit/playwright';
import { openHomePage } from '@affine-test/kit/utils/load-page';
import { waitForEditorLoad } from '@affine-test/kit/utils/page-logic';
import { openWorkspaceSettingPanel } from '@affine-test/kit/utils/setting';
import { openSettingModal } from '@affine-test/kit/utils/setting';
import {
openSettingModal,
openWorkspaceSettingPanel,
} from '@affine-test/kit/utils/setting';
import { clickSideBarCurrentWorkspaceBanner } from '@affine-test/kit/utils/sidebar';
import { expect } from '@playwright/test';

View File

@@ -7,7 +7,8 @@ import {
waitForEditorLoad,
} from '@affine-test/kit/utils/page-logic';
import { clickSideBarAllPageButton } from '@affine-test/kit/utils/sidebar';
import { expect, type Page } from '@playwright/test';
import type { Page } from '@playwright/test';
import { expect } from '@playwright/test';
const historyShortcut = async (page: Page, command: 'goBack' | 'goForward') => {
await withCtrlOrMeta(page, () =>

View File

@@ -7,7 +7,8 @@ import {
waitForEditorLoad,
} from '@affine-test/kit/utils/page-logic';
import { clickSideBarAllPageButton } from '@affine-test/kit/utils/sidebar';
import { expect, type Locator, type Page } from '@playwright/test';
import type { Locator, Page } from '@playwright/test';
import { expect } from '@playwright/test';
const openQuickSearchByShortcut = async (page: Page, checkVisible = true) => {
await withCtrlOrMeta(page, () => page.keyboard.press('k', { delay: 50 }));

View File

@@ -5,7 +5,8 @@ import path, { resolve } from 'node:path';
import process from 'node:process';
import type { DocCollection } from '@blocksuite/store';
import { type BrowserContext, test as baseTest } from '@playwright/test';
import type { BrowserContext } from '@playwright/test';
import { test as baseTest } from '@playwright/test';
export const rootDir = resolve(__dirname, '..', '..');
// assert that the rootDir is the root of the project

View File

@@ -10,12 +10,8 @@ import {
} from '@affine-test/kit/utils/sidebar';
import { faker } from '@faker-js/faker';
import { hash } from '@node-rs/argon2';
import {
type BrowserContext,
type Cookie,
expect,
type Page,
} from '@playwright/test';
import type { BrowserContext, Cookie, Page } from '@playwright/test';
import { expect } from '@playwright/test';
import { z } from 'zod';
export async function getCurrentMailMessageCount() {

View File

@@ -1,4 +1,5 @@
import { expect, type Page } from '@playwright/test';
import type { Page } from '@playwright/test';
import { expect } from '@playwright/test';
export const coreUrl = 'http://localhost:8080';

View File

@@ -1,4 +1,5 @@
import { expect, type Page } from '@playwright/test';
import type { Page } from '@playwright/test';
import { expect } from '@playwright/test';
export const getPropertyValueLocator = (page: Page, property: string) => {
return page.locator(

View File

@@ -1,4 +1,5 @@
import { expect, type Page } from '@playwright/test';
import type { Page } from '@playwright/test';
import { expect } from '@playwright/test';
import { waitForEditorLoad } from './page-logic';

View File

@@ -1,22 +1,21 @@
import {
AddPageButton,
AppSidebar,
AppSidebarFallback,
appSidebarOpenAtom,
SidebarSwitch,
} from '@affine/core/components/app-sidebar';
import { AddPageButton } from '@affine/core/components/app-sidebar';
import { CategoryDivider } from '@affine/core/components/app-sidebar';
import { navHeaderStyle } from '@affine/core/components/app-sidebar';
import { MenuLinkItem } from '@affine/core/components/app-sidebar';
import { QuickSearchInput } from '@affine/core/components/app-sidebar';
import {
CategoryDivider,
MenuLinkItem,
navHeaderStyle,
QuickSearchInput,
SidebarContainer,
SidebarScrollableContainer,
SidebarSwitch,
} from '@affine/core/components/app-sidebar';
import { DeleteTemporarilyIcon, SettingsIcon } from '@blocksuite/icons';
import type { Meta, StoryFn } from '@storybook/react';
import { useAtom } from 'jotai';
import { type PropsWithChildren, useState } from 'react';
import type { PropsWithChildren } from 'react';
import { useState } from 'react';
import { MemoryRouter } from 'react-router-dom';
export default {

View File

@@ -1,7 +1,5 @@
import {
type AddPageButtonProps,
AppUpdaterButton,
} from '@affine/core/components/app-sidebar';
import type { AddPageButtonProps } from '@affine/core/components/app-sidebar';
import { AppUpdaterButton } from '@affine/core/components/app-sidebar';
import type { Meta, StoryFn } from '@storybook/react';
import type { PropsWithChildren } from 'react';

View File

@@ -1,7 +1,6 @@
import { BlockSuiteEditor } from '@affine/core/components/blocksuite/block-suite-editor';
import { AffineSchemas } from '@blocksuite/blocks/schemas';
import { DocCollection } from '@blocksuite/store';
import { Schema } from '@blocksuite/store';
import { DocCollection, Schema } from '@blocksuite/store';
import type { StoryFn } from '@storybook/react';
import { initEmptyPage } from '@toeverything/infra';

View File

@@ -3,12 +3,12 @@ import { ImagePreviewModal } from '@affine/core/components/image-preview';
import type { Meta } from '@storybook/react';
import type { Doc } from '@toeverything/infra';
import {
initEmptyPage,
PageManager,
ServiceProviderContext,
useService,
Workspace,
} from '@toeverything/infra';
import { initEmptyPage } from '@toeverything/infra';
import { useEffect, useState } from 'react';
import { createPortal } from 'react-dom';

View File

@@ -1,8 +1,7 @@
/* deepscan-disable USELESS_ARROW_FUNC_BIND */
import { toast } from '@affine/component';
import { ImportPage } from '@affine/component/import-page';
import type { StoryFn } from '@storybook/react';
import type { Meta } from '@storybook/react';
import type { Meta, StoryFn } from '@storybook/react';
export default {
title: 'AFFiNE/ImportPage',

View File

@@ -1,7 +1,6 @@
import { PagePropertiesTable } from '@affine/core/components/affine/page-properties';
import { AffineSchemas } from '@blocksuite/blocks/schemas';
import { DocCollection } from '@blocksuite/store';
import { Schema } from '@blocksuite/store';
import { DocCollection, Schema } from '@blocksuite/store';
import type { StoryFn } from '@storybook/react';
import { initEmptyPage } from '@toeverything/infra';

View File

@@ -1,17 +1,19 @@
import { toast } from '@affine/component';
import type {
ListItem,
ListProps,
PageListItemProps,
PageOperationCellProps,
PageTagsProps,
} from '@affine/core/components/page-list';
import {
FloatingToolbar,
List,
type ListItem,
type ListProps,
ListScrollContainer,
NewPageButton,
PageListItem,
type PageListItemProps,
PageOperationCell,
type PageOperationCellProps,
PageTags,
type PageTagsProps,
} from '@affine/core/components/page-list';
import { topLevelRoutes } from '@affine/core/router';
import { AffineSchemas } from '@blocksuite/blocks/schemas';

View File

@@ -2,12 +2,10 @@ import { toast } from '@affine/component';
import { PublicLinkDisableModal } from '@affine/component/disable-public-link';
import { ShareMenu } from '@affine/core/components/affine/share-page-modal/share-menu';
import { WorkspaceFlavour } from '@affine/env/workspace';
import { type Doc } from '@blocksuite/store';
import type { Doc } from '@blocksuite/store';
import { expect } from '@storybook/jest';
import type { Meta, StoryFn } from '@storybook/react';
import { Workspace } from '@toeverything/infra';
import { initEmptyPage } from '@toeverything/infra';
import { useService } from '@toeverything/infra';
import { initEmptyPage, useService, Workspace } from '@toeverything/infra';
import { nanoid } from 'nanoid';
import { useEffect, useState } from 'react';

View File

@@ -1,8 +1,7 @@
import type { WorkspaceListProps } from '@affine/component/workspace-list';
import { WorkspaceList } from '@affine/component/workspace-list';
import type { Meta } from '@storybook/react';
import { WorkspaceManager } from '@toeverything/infra';
import { useLiveData, useService } from '@toeverything/infra';
import { useLiveData, useService, WorkspaceManager } from '@toeverything/infra';
export default {
title: 'AFFiNE/WorkspaceList',