chore(frontend): introduce prettier + eslint and prune unused code
Backend CI / Backend (push) Has been cancelled
Frontend CI / Frontend (push) Failing after 1m39s

- 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:
2026-05-01 20:39:09 +08:00
parent 21c7892ee4
commit 162abdc97c
258 changed files with 42261 additions and 37556 deletions
@@ -1,45 +1,48 @@
<script setup lang="ts">
import { computed } from "vue";
import { useI18n } from "vue-i18n";
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
import type { PublishPlatformOption } from "@/lib/publish-platforms";
import type { PublishPlatformOption } from '@/lib/publish-platforms'
const props = withDefaults(defineProps<{
modelValue: string[];
platforms: PublishPlatformOption[];
disabled?: boolean;
multiple?: boolean;
}>(), {
disabled: false,
multiple: true,
});
const props = withDefaults(
defineProps<{
modelValue: string[]
platforms: PublishPlatformOption[]
disabled?: boolean
multiple?: boolean
}>(),
{
disabled: false,
multiple: true,
},
)
const emit = defineEmits<{
"update:modelValue": [value: string[]];
}>();
'update:modelValue': [value: string[]]
}>()
const { t } = useI18n();
const { t } = useI18n()
const selectedValues = computed(() => props.modelValue ?? []);
const selectedValues = computed(() => props.modelValue ?? [])
function isSelected(platformId: string): boolean {
return selectedValues.value.includes(platformId);
return selectedValues.value.includes(platformId)
}
function togglePlatform(platformId: string): void {
if (props.disabled) {
return;
return
}
if (props.multiple) {
const next = isSelected(platformId)
? selectedValues.value.filter((item) => item !== platformId)
: [...selectedValues.value, platformId];
emit("update:modelValue", next);
return;
: [...selectedValues.value, platformId]
emit('update:modelValue', next)
return
}
emit("update:modelValue", isSelected(platformId) ? [] : [platformId]);
emit('update:modelValue', isSelected(platformId) ? [] : [platformId])
}
</script>
@@ -72,18 +75,22 @@ function togglePlatform(platformId: string): void {
<strong>{{ platform.name }}</strong>
</span>
<span
<span
class="publish-platform-selector__status"
:class="{ 'publish-platform-selector__status--bound': platform.bound }"
>
{{ platform.bound ? (platform.accountLabel ?? t("custom.task.platformConnected")) : t("custom.task.platformUnauthorized") }}
{{
platform.bound
? (platform.accountLabel ?? t('custom.task.platformConnected'))
: t('custom.task.platformUnauthorized')
}}
</span>
</button>
</div>
<div v-else class="publish-platform-selector__empty">
<strong>{{ t("custom.task.platformEmptyTitle") }}</strong>
<p>{{ t("custom.task.platformEmptyHint") }}</p>
<strong>{{ t('custom.task.platformEmptyTitle') }}</strong>
<p>{{ t('custom.task.platformEmptyHint') }}</p>
</div>
</div>
</template>