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

@@ -16,8 +16,7 @@ import createEmotionCache from '@affine/core/utils/create-emotion-cache';
import { configureWebServices } from '@affine/core/web';
import { createI18n, setUpLanguage } from '@affine/i18n';
import { CacheProvider } from '@emotion/react';
import { getCurrentStore } from '@toeverything/infra';
import { ServiceCollection } from '@toeverything/infra';
import { getCurrentStore, ServiceCollection } from '@toeverything/infra';
import mixpanel from 'mixpanel-browser';
import type { PropsWithChildren, ReactElement } from 'react';
import { lazy, Suspense } from 'react';

View File

@@ -1,8 +1,5 @@
import {
type InsertRow,
SqliteConnection,
ValidationResult,
} from '@affine/native';
import type { InsertRow } from '@affine/native';
import { SqliteConnection, ValidationResult } from '@affine/native';
import { WorkspaceVersion } from '@toeverything/infra';
import { applyGuidCompatibilityFix, migrateToLatest } from '../db/migration';

View File

@@ -1,5 +1,4 @@
import type { Subject } from 'rxjs';
import { Observable } from 'rxjs';
import {
concat,
defer,
@@ -8,6 +7,7 @@ import {
interval,
lastValueFrom,
merge,
Observable,
} from 'rxjs';
import {
concatMap,

View File

@@ -1,4 +1,5 @@
import { clipboard, type IpcMainInvokeEvent, nativeImage } from 'electron';
import type { IpcMainInvokeEvent } from 'electron';
import { clipboard, nativeImage } from 'electron';
import type { NamespaceHandlers } from '../type';

View File

@@ -1,6 +1,7 @@
import path from 'node:path';
import { type App, type BrowserWindow, ipcMain } from 'electron';
import type { App, BrowserWindow } from 'electron';
import { ipcMain } from 'electron';
import { buildType, CLOUD_BASE_URL, isDev } from './config';
import { mainWindowOrigin } from './constants';

View File

@@ -1,14 +1,14 @@
import path from 'node:path';
import { type _AsyncVersionOf, AsyncCall } from 'async-call-rpc';
import type { _AsyncVersionOf } from 'async-call-rpc';
import { AsyncCall } from 'async-call-rpc';
import type { UtilityProcess, WebContents } from 'electron';
import {
app,
dialog,
MessageChannelMain,
shell,
type UtilityProcess,
utilityProcess,
type WebContents,
} from 'electron';
import type { HelperToMain, MainToHelper } from '../shared/type';

View File

@@ -1,5 +1,4 @@
import { shell } from 'electron';
import { app } from 'electron';
import { app, shell } from 'electron';
import log from 'electron-log';
export const logger = log.scope('main');

View File

@@ -1,7 +1,8 @@
import assert from 'node:assert';
import { join } from 'node:path';
import { BrowserWindow, type CookiesSetDetails, nativeTheme } from 'electron';
import type { CookiesSetDetails } from 'electron';
import { BrowserWindow, nativeTheme } from 'electron';
import electronWindowState from 'electron-window-state';
import { isLinux, isMacOS, isWindows } from '../shared/utils';

View File

@@ -1,6 +1,7 @@
import { join } from 'node:path';
import { BrowserWindow, type Display, screen } from 'electron';
import type { Display } from 'electron';
import { BrowserWindow, screen } from 'electron';
import { isMacOS } from '../shared/utils';
import { mainWindowOrigin } from './constants';

View File

@@ -6,16 +6,16 @@ import type {
XElement,
} from 'builder-util-runtime';
import { HttpError, newError, parseXml } from 'builder-util-runtime';
import {
type AppUpdater,
CancellationToken,
type ResolvedUpdateFileInfo,
type UpdateInfo,
import type {
AppUpdater,
ResolvedUpdateFileInfo,
UpdateInfo,
} from 'electron-updater';
import { CancellationToken } from 'electron-updater';
import { BaseGitHubProvider } from 'electron-updater/out/providers/GitHubProvider';
import type { ProviderRuntimeOptions } from 'electron-updater/out/providers/Provider';
import {
parseUpdateInfo,
type ProviderRuntimeOptions,
resolveFiles,
} from 'electron-updater/out/providers/Provider';
import * as semver from 'semver';

View File

@@ -1,13 +1,14 @@
import { app, type IpcMainInvokeEvent } from 'electron';
import type { IpcMainInvokeEvent } from 'electron';
import { app } from 'electron';
import type { NamespaceHandlers } from '../type';
import type { UpdaterConfig } from './electron-updater';
import {
checkForUpdates,
downloadUpdate,
getConfig,
quitAndInstall,
setConfig,
type UpdaterConfig,
} from './electron-updater';
export const updaterHandlers = {

View File

@@ -1,5 +1,6 @@
// Please add modules to `external` in `rollupOptions` to avoid wrong bundling.
import { AsyncCall, type EventBasedChannel } from 'async-call-rpc';
import type { EventBasedChannel } from 'async-call-rpc';
import { AsyncCall } from 'async-call-rpc';
import { ipcRenderer } from 'electron';
import { Subject } from 'rxjs';
import { z } from 'zod';

View File

@@ -2,7 +2,8 @@ import 'electron-updater'; // Prevent BaseUpdater is undefined.
import { randomBytes } from 'node:crypto';
import { type AllPublishOptions, UUID } from 'builder-util-runtime';
import type { AllPublishOptions } from 'builder-util-runtime';
import { UUID } from 'builder-util-runtime';
import type { AppAdapter } from 'electron-updater/out/AppAdapter';
import type { DownloadUpdateOptions } from 'electron-updater/out/AppUpdater';
import type { InstallOptions } from 'electron-updater/out/BaseUpdater';