chore(frontend): introduce prettier + eslint and prune unused code
- Add Prettier 3 with prettier-plugin-organize-imports (sorts/removes unused imports) - Add ESLint 10 flat config with typescript-eslint + eslint-plugin-vue + eslint-config-prettier - Add root scripts: format, format:check, lint, lint:fix - Reformat 257 files across admin-web, ops-web, desktop-client, packages - Remove unused locals/exports flagged by --noUnusedLocals/--noUnusedParameters - Fix duplicate localTabLabel key, surrogate-pair regex u-flag, NBSP literal in regex - Skip server/ (Go) and apps/browser-extension/ (deprecated per ADR) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -7,70 +7,68 @@ import {
|
||||
EditOutlined,
|
||||
TeamOutlined,
|
||||
ThunderboltOutlined,
|
||||
} from "@ant-design/icons-vue";
|
||||
import { computed, type Component } from "vue";
|
||||
} from '@ant-design/icons-vue'
|
||||
import { computed, type Component } from 'vue'
|
||||
|
||||
import { formatDateTime, getSourceTypeLabel } from "@/lib/display";
|
||||
import { formatDateTime, getSourceTypeLabel } from '@/lib/display'
|
||||
|
||||
const props = defineProps<{
|
||||
sourceType?: string | null;
|
||||
generationMode?: string | null;
|
||||
createdAt?: string | null;
|
||||
}>();
|
||||
sourceType?: string | null
|
||||
generationMode?: string | null
|
||||
createdAt?: string | null
|
||||
}>()
|
||||
|
||||
const sourceLabel = computed(() =>
|
||||
getSourceTypeLabel(props.sourceType, props.generationMode),
|
||||
);
|
||||
const sourceLabel = computed(() => getSourceTypeLabel(props.sourceType, props.generationMode))
|
||||
|
||||
const createdAtLabel = computed(() => formatDateTime(props.createdAt));
|
||||
const createdAtLabel = computed(() => formatDateTime(props.createdAt))
|
||||
|
||||
const sourceVariant = computed<
|
||||
"template" | "custom" | "instant" | "schedule" | "free-create" | "imitation" | "kol" | "default"
|
||||
'template' | 'custom' | 'instant' | 'schedule' | 'free-create' | 'imitation' | 'kol' | 'default'
|
||||
>(() => {
|
||||
if (props.sourceType === "template") {
|
||||
return "template";
|
||||
if (props.sourceType === 'template') {
|
||||
return 'template'
|
||||
}
|
||||
if (props.sourceType === "free_create") {
|
||||
return "free-create";
|
||||
if (props.sourceType === 'free_create') {
|
||||
return 'free-create'
|
||||
}
|
||||
if (props.sourceType === "imitation") {
|
||||
return "imitation";
|
||||
if (props.sourceType === 'imitation') {
|
||||
return 'imitation'
|
||||
}
|
||||
if (props.sourceType === "kol") {
|
||||
return "kol";
|
||||
if (props.sourceType === 'kol') {
|
||||
return 'kol'
|
||||
}
|
||||
if (props.sourceType === "custom_generation") {
|
||||
if (props.generationMode === "schedule") {
|
||||
return "schedule";
|
||||
if (props.sourceType === 'custom_generation') {
|
||||
if (props.generationMode === 'schedule') {
|
||||
return 'schedule'
|
||||
}
|
||||
if (props.generationMode === "instant") {
|
||||
return "instant";
|
||||
if (props.generationMode === 'instant') {
|
||||
return 'instant'
|
||||
}
|
||||
return "custom";
|
||||
return 'custom'
|
||||
}
|
||||
return "default";
|
||||
});
|
||||
return 'default'
|
||||
})
|
||||
|
||||
const badgeIcon = computed<Component>(() => {
|
||||
switch (sourceVariant.value) {
|
||||
case "template":
|
||||
return AppstoreOutlined;
|
||||
case "instant":
|
||||
return ThunderboltOutlined;
|
||||
case "schedule":
|
||||
return CalendarOutlined;
|
||||
case "custom":
|
||||
return ThunderboltOutlined;
|
||||
case "free-create":
|
||||
return EditOutlined;
|
||||
case "imitation":
|
||||
return CopyOutlined;
|
||||
case "kol":
|
||||
return TeamOutlined;
|
||||
case 'template':
|
||||
return AppstoreOutlined
|
||||
case 'instant':
|
||||
return ThunderboltOutlined
|
||||
case 'schedule':
|
||||
return CalendarOutlined
|
||||
case 'custom':
|
||||
return ThunderboltOutlined
|
||||
case 'free-create':
|
||||
return EditOutlined
|
||||
case 'imitation':
|
||||
return CopyOutlined
|
||||
case 'kol':
|
||||
return TeamOutlined
|
||||
default:
|
||||
return AppstoreOutlined;
|
||||
return AppstoreOutlined
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user