Apply formatting and minor style fixes across repo

Normalize code style across multiple packages: whitespace cleanup, consistent commas and trailing commas in arrays/enums/objects, fix table markdown lines in CI comment template, ensure newline at EOF, normalize header/object property quoting and spacing, remove stray blank lines and minor non-functional comment tweaks. These are formatting-only changes and small type/annotation spacing adjustments; no functional behavior changes intended.
This commit is contained in:
手瓜一十雪 committed 2026-03-05 18:45:50 +08:00
1 parent d2d0b258bc
commit 974528fe7e
186 files changed
+1367 -1233

No files matched your search

+1 -1
View File
@@ -601,7 +601,7 @@ export async function NCoreInitShell () {
const wrapper = loadQQWrapper(basicInfoWrapper.QQMainPath, basicInfoWrapper.getFullQQVersion());
// wrapper.node 加载后再初始化 hook,按 schema 读取配置
const napcatConfig = loadNapcatConfig(pathWrapper.configPath);
await nativePacketHandler.init(basicInfoWrapper.getFullQQVersion(), napcatConfig.o3HookMode === 1 ? true : false);
await nativePacketHandler.init(basicInfoWrapper.getFullQQVersion(), napcatConfig.o3HookMode === 1);
// 登录前监听 OidbSvcTrpcTcp.0xcde_2 数据包,获取数据库 passphrase
let dbPassphrase: string | undefined;
+2 -5
View File
@@ -42,7 +42,6 @@ const ENV = {
isPipeDisabled: process.env['NAPCAT_DISABLE_PIPE'] === '1',
} as const;
// Worker 消息类型
interface WorkerMessage {
type: 'restart' | 'restart-prepare' | 'shutdown' | 'login-success';
@@ -50,7 +49,6 @@ interface WorkerMessage {
port?: number;
}
const logger = new LogWrapper(pathWrapper.logsPath);
if (!ENV.isWorkerProcess && !ENV.isMultiProcessDisabled) {
logger.setFileLogEnabled(false);
@@ -68,7 +66,6 @@ const recentCrashTimestamps: number[] = [];
const CRASH_TIME_WINDOW = 10000; // 10秒时间窗口
const MAX_CRASHES_IN_WINDOW = 3; // 最大崩溃次数
/**
* 获取进程类型名称(用于日志)
*/
@@ -112,7 +109,7 @@ function forceKillProcess (pid: number): void {
logger.logError(`[NapCat] [Process] 强制终止进程失败: PID ${pid}`);
}
} else {
logger.logError(`[NapCat] [Process] 强制终止进程失败:`, error);
logger.logError('[NapCat] [Process] 强制终止进程失败:', error);
}
}
}
@@ -414,7 +411,7 @@ async function startWorkerProcess (): Promise<void> {
logger.logError('[NapCat] [Process] 发送重启请求失败:', e);
return {
result: false,
message: '发送重启请求失败: ' + (e as Error).message
message: '发送重启请求失败: ' + (e as Error).message,
};
}
});
+1 -1
View File
@@ -11,7 +11,7 @@ import react from '@vitejs/plugin-react-swc';
const external = [
'ws',
'express',
'electron'
'electron',
];
const nodeModules = [...builtinModules, builtinModules.map((m) => `node:${m}`), 'node:sqlite'].flat();