build: 引入 ESLint 防回潮基建 + 清理存量未使用 import
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { lazy, Suspense, useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { lazy, Suspense, useCallback, useEffect, useState } from "react";
|
||||
import {
|
||||
BugOutlined,
|
||||
CheckCircleFilled,
|
||||
|
||||
@@ -108,7 +108,7 @@ export interface ComplianceCheck {
|
||||
}
|
||||
|
||||
function findJsonSlice(raw: string): string {
|
||||
const start = raw.search(/[\[{]/);
|
||||
const start = raw.search(/[{[]/);
|
||||
if (start < 0) return raw;
|
||||
|
||||
const stack: string[] = [];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export type ToastType = "success" | "error" | "info";
|
||||
|
||||
|
||||
@@ -26,15 +26,8 @@ import {
|
||||
} from "@ant-design/icons";
|
||||
import {
|
||||
ArrowsCounterClockwise,
|
||||
Fire,
|
||||
FrameCorners,
|
||||
Gift,
|
||||
MagicWand,
|
||||
Mountains,
|
||||
PaperPlaneRight,
|
||||
ShoppingBag,
|
||||
User,
|
||||
VideoCamera,
|
||||
} from "@phosphor-icons/react";
|
||||
import { Fragment, useEffect, useMemo, useRef, useState, type CSSProperties, type ChangeEvent, type DragEvent, type KeyboardEvent as ReactKeyboardEvent, type MouseEvent as ReactMouseEvent, type PointerEvent as ReactPointerEvent, type ReactNode } from "react";
|
||||
import { createPortal } from "react-dom";
|
||||
@@ -58,43 +51,25 @@ import EcommerceCopywritingPanel from "./panels/EcommerceCopywritingPanel";
|
||||
import { ecommerceOssScopes, saveUnifiedEcommerceGenerationRecord, deleteEcommerceGenerationRecord } from "./ecommerceGenerationPersistence";
|
||||
import { downloadResultAsset } from "../workbench/workbenchDownload";
|
||||
import {
|
||||
appendEnglish,
|
||||
defaultCloneOutput,
|
||||
defaultEcommercePlatform,
|
||||
defaultMarketLanguageOption,
|
||||
defaultPlatformSpec,
|
||||
defaultProductSetOutput,
|
||||
domesticPlatformLabels,
|
||||
domesticPlatformLanguages,
|
||||
formatUploadedImageRatio,
|
||||
getMarketLanguageOptions,
|
||||
getPlatformDefaultLanguage,
|
||||
getPlatformDefaultRatio,
|
||||
getPlatformLanguageOptions,
|
||||
getPlatformRatioGroup,
|
||||
getPlatformRatioOptions,
|
||||
getPlatformSpec,
|
||||
getUniqueRatioOptions,
|
||||
isDomesticPlatform,
|
||||
languageAliases,
|
||||
legacyPlatformAliases,
|
||||
marketLanguageOptions,
|
||||
marketOptions,
|
||||
normalizeLanguage,
|
||||
normalizeLanguageForPlatform,
|
||||
normalizeMarket,
|
||||
normalizePlatform,
|
||||
normalizeRatioForPlatform,
|
||||
platformOptions,
|
||||
platformSpecOptions,
|
||||
uniqueLanguages,
|
||||
} from "./utils/platformRules";
|
||||
import type {
|
||||
CloneOutputKey,
|
||||
PlatformRatioModeKey,
|
||||
ProductSetOutputKey,
|
||||
} from "./utils/platformRules";
|
||||
import type { EcommercePlatformSpec, PlatformRatioGroup } from "./utils/platformRules";
|
||||
import {
|
||||
buildHistoryTurnFromRecord,
|
||||
cloneLatestSettingStorageKey,
|
||||
@@ -102,15 +77,9 @@ import {
|
||||
defaultCloneSetCounts,
|
||||
ecommerceHistoryStorageKey,
|
||||
getTurnResults,
|
||||
isCloneImageItem,
|
||||
isCloneResult,
|
||||
isCloneSavedSetting,
|
||||
isEcommerceHistoryRecord,
|
||||
normalizeEcommerceHistoryRecord,
|
||||
normalizeEcommerceHistoryTurn,
|
||||
readCloneLatestSetting,
|
||||
readEcommerceHistoryRecords,
|
||||
removeFilePayloadFromImages,
|
||||
writeCloneLatestSetting,
|
||||
writeEcommerceHistoryRecords,
|
||||
} from "./utils/clonePersistence";
|
||||
@@ -275,18 +244,13 @@ import {
|
||||
rgbToHex,
|
||||
} from "./utils/colorUtils";
|
||||
import {
|
||||
formatAspectRatio,
|
||||
formatRatioDisplayValue,
|
||||
getQuickSetRatioValue,
|
||||
getRatioDisplayParts,
|
||||
greatestCommonDivisor,
|
||||
normalizeRatioForApi,
|
||||
normalizeRatioToken,
|
||||
parseRatioToAspectCss,
|
||||
quickSetRatioOptions,
|
||||
supportedImageApiRatios,
|
||||
toSupportedImageApiRatio,
|
||||
type SupportedImageApiRatio,
|
||||
} from "./utils/ratioUtils";
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import "../../styles/pages/ecommerce-video.css";
|
||||
import {
|
||||
CloseOutlined,
|
||||
@@ -33,7 +33,6 @@ import { useGenerationTasks } from "../../hooks/useGenerationTasks";
|
||||
import {
|
||||
saveEcommerceVideoState,
|
||||
loadEcommerceVideoState,
|
||||
clearEcommerceVideoState,
|
||||
} from "./ecommerceVideoKeepalive";
|
||||
import { saveUnifiedEcommerceGenerationRecord } from "./ecommerceGenerationPersistence";
|
||||
import { useVideoSceneRunner } from "./useVideoSceneRunner";
|
||||
|
||||
@@ -4,7 +4,6 @@ import {
|
||||
CopyOutlined,
|
||||
EditOutlined,
|
||||
FileTextOutlined,
|
||||
FireOutlined,
|
||||
GlobalOutlined,
|
||||
MessageOutlined,
|
||||
SmileOutlined,
|
||||
|
||||
@@ -13,8 +13,6 @@ import {
|
||||
} from "./ecommerceVideoService";
|
||||
import { waitForTask } from "../../api/taskSubscription";
|
||||
import { ServerRequestError } from "../../api/serverConnection";
|
||||
import { ENTERPRISE_DEFAULT_VIDEO_MODEL } from "../../utils/enterpriseVideoPolicy";
|
||||
import { resolveVideoRequestModel } from "../../utils/resolveVideoModel";
|
||||
import {
|
||||
saveEcommerceVideoState,
|
||||
} from "./ecommerceVideoKeepalive";
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { create } from "zustand";
|
||||
import type { WebGenerationPreviewTask } from "../types";
|
||||
|
||||
export type QueueItemStatus = "pending" | "running" | "completed" | "failed" | "cancelled";
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
export type WebViewKey =
|
||||
| "home"
|
||||
|
||||
@@ -10,7 +10,7 @@ interface ErrorReport {
|
||||
sessionId?: string;
|
||||
}
|
||||
|
||||
let reportQueue: ErrorReport[] = [];
|
||||
const reportQueue: ErrorReport[] = [];
|
||||
let flushTimer: ReturnType<typeof setTimeout> | null = null;
|
||||
|
||||
function getSessionId(): string | undefined {
|
||||
|
||||
Reference in New Issue
Block a user