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,45 @@
import { app } from "electron/main";
import type { WebContents } from "electron/main";
import type { WebContents } from 'electron/main'
import { app } from 'electron/main'
function normalizeBooleanEnv(value: string | undefined): boolean | null {
if (!value) {
return null;
return null
}
const normalized = value.trim().toLowerCase();
if (["1", "true", "yes", "on"].includes(normalized)) {
return true;
const normalized = value.trim().toLowerCase()
if (['1', 'true', 'yes', 'on'].includes(normalized)) {
return true
}
if (["0", "false", "no", "off"].includes(normalized)) {
return false;
if (['0', 'false', 'no', 'off'].includes(normalized)) {
return false
}
return null;
return null
}
export function shouldAutoOpenExecutionDevtools(): boolean {
if (app.isPackaged) {
return false;
return false
}
const explicit = normalizeBooleanEnv(process.env.GEO_DESKTOP_EXECUTION_DEVTOOLS);
const explicit = normalizeBooleanEnv(process.env.GEO_DESKTOP_EXECUTION_DEVTOOLS)
if (explicit !== null) {
return explicit;
return explicit
}
return Boolean(process.env.ELECTRON_RENDERER_URL);
return Boolean(process.env.ELECTRON_RENDERER_URL)
}
export function shouldAutoOpenBackgroundExecutionDevtools(): boolean {
if (app.isPackaged) {
return false;
return false
}
const explicit = normalizeBooleanEnv(process.env.GEO_DESKTOP_EXECUTION_DEVTOOLS);
const explicit = normalizeBooleanEnv(process.env.GEO_DESKTOP_EXECUTION_DEVTOOLS)
if (explicit !== null) {
return explicit;
return explicit
}
return false;
return false
}
export function maybeOpenExecutionDevtools(
@@ -49,18 +49,18 @@ export function maybeOpenExecutionDevtools(
): void {
const allowOpen = options.background
? shouldAutoOpenBackgroundExecutionDevtools()
: shouldAutoOpenExecutionDevtools();
: shouldAutoOpenExecutionDevtools()
if (!allowOpen) {
return;
return
}
if (webContents.isDestroyed() || webContents.isDevToolsOpened()) {
return;
return
}
try {
webContents.openDevTools({ mode: "detach" });
console.info("[desktop-devtools] opened execution devtools", { label });
webContents.openDevTools({ mode: 'detach' })
console.info('[desktop-devtools] opened execution devtools', { label })
} catch (error) {
console.warn("[desktop-devtools] failed to open execution devtools", { label, error });
console.warn('[desktop-devtools] failed to open execution devtools', { label, error })
}
}