chore(lint): remove ESLint configuration file and update lint scripts

- Deleted the .eslintrc.cjs file to simplify configuration management.
- Updated lint scripts in package.json to remove unnecessary extensions for linting.
- Added new devDependencies for ESLint and globals to enhance linting capabilities.
This commit is contained in:
Haze
2026-02-06 05:50:20 +08:00
Unverified
parent 4e1f79922b
commit 9fe27e3510
23 changed files with 90 additions and 45 deletions

View File

@@ -698,10 +698,11 @@ export class GatewayManager extends EventEmitter {
this.emit('chat:message', notification.params as { message: unknown });
break;
case GatewayEventType.ERROR:
case GatewayEventType.ERROR: {
const errorData = notification.params as { message?: string };
this.emit('error', new Error(errorData.message || 'Gateway error'));
break;
}
default:
// Unknown notification type, just log it

View File

@@ -2,13 +2,13 @@
* Electron Main Process Entry
* Manages window creation, system tray, and IPC handlers
*/
import { app, BrowserWindow, ipcMain, session, shell } from 'electron';
import { app, BrowserWindow, session, shell } from 'electron';
import { join } from 'path';
import { GatewayManager } from '../gateway/manager';
import { registerIpcHandlers } from './ipc-handlers';
import { createTray } from './tray';
import { createMenu } from './menu';
import { PORTS } from '../utils/config';
import { appUpdater, registerUpdateHandlers } from './updater';
// Disable GPU acceleration for better compatibility

View File

@@ -11,7 +11,7 @@ import {
hasApiKey,
saveProvider,
getProvider,
getAllProviders,
deleteProvider,
setDefaultProvider,
getDefaultProvider,

View File

@@ -13,6 +13,7 @@ interface WindowState {
}
// Lazy-load electron-store (ESM module)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let windowStateStore: any = null;
async function getStore() {
@@ -89,6 +90,7 @@ export async function saveWindowState(win: BrowserWindow): Promise<void> {
export function trackWindowState(win: BrowserWindow): void {
// Save state on window events
['resize', 'move', 'close'].forEach((event) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
win.on(event as any, () => saveWindowState(win));
});
}

View File

@@ -161,6 +161,7 @@ const electronAPI = {
*/
off: (channel: string, callback?: (...args: unknown[]) => void) => {
if (callback) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
ipcRenderer.removeListener(channel, callback as any);
} else {
ipcRenderer.removeAllListeners(channel);

View File

@@ -70,7 +70,7 @@ function writeToFile(formatted: string): void {
if (logFilePath) {
try {
appendFileSync(logFilePath, formatted + '\n');
} catch (error) {
} catch {
// Silently fail if we can't write to file
}
}

View File

@@ -5,7 +5,9 @@
import { safeStorage } from 'electron';
// Lazy-load electron-store (ESM module)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let store: any = null;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let providerStore: any = null;
async function getStore() {

View File

@@ -6,6 +6,7 @@
import { randomBytes } from 'crypto';
// Lazy-load electron-store (ESM module)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let settingsStoreInstance: any = null;
/**
@@ -142,7 +143,7 @@ export async function importSettings(json: string): Promise<void> {
const settings = JSON.parse(json);
const store = await getSettingsStore();
store.set(settings);
} catch (error) {
} catch {
throw new Error('Invalid settings JSON');
}
}