Add TypeScript ESLint configs and lint scripts

Add a repository .editorconfig and a root eslint.config.ts to standardize formatting and linting. Migrate packages/webui ESLint config to TypeScript (eslint.config.ts) with project-specific rules and tsconfigRootDir handling, and remove the old JS config. Update package.json to run ESLint directly (add lint and lint:fix) and add required ESLint/dev dependencies; also add jiti to packages/webui/package.json. Include a small formatting tweak to tsconfig.base.json.
This commit is contained in:
手瓜一十雪 committed 2026-05-20 19:08:45 +08:00
1 parent f21740a5d3
commit aea2676c31
30 files changed
+173 -1057

No files matched your search

+1 -1
View File
@@ -15,7 +15,7 @@
// envelope retCode via the non-generic `OidbBaseMeta` view.
import type { Bridge } from './bridge';
import { protobuf_encode, protobuf_decode } from '@snowluma/proton';
import { protobuf_decode } from '@snowluma/proton';
import type { OidbBase, OidbBaseMeta } from './proto/proton/oidb';
/**
+1 -4
View File
@@ -3,7 +3,7 @@
// Heavy OIDB / contact / action logic is split into bridge-oidb, bridge-contacts, bridge-actions.
import type { PacketInfo } from '../protocol/types';
import type { ForwardNodePayload, QQEventVariant, MessageElement } from './events';
import type { ForwardNodePayload, MessageElement } from './events';
import type { FriendInfo, QQGroupInfo, GroupMemberInfo, UserProfileInfo, GroupRequestInfo } from './qq-info';
import { MSG_PUSH_CMD, parseMsgPush } from './msg-push';
import type { PacketSender, SendPacketResult } from '../protocol/packet-sender';
@@ -12,7 +12,6 @@ import { buildSendElems } from './element-builder';
import { IdentityService } from './identity-service';
import type { BridgeInterface } from './bridge-interface';
import { IncomingPacketPipeline, type CmdParser } from './packet-pipeline';
import { createLogger } from '../utils/logger';
import type {
SendMessageRequest,
SendMessageResponse,
@@ -185,8 +184,6 @@ export interface ClientKeyInfo {
keyIndex: string
}
const log = createLogger('Bridge');
export class Bridge implements BridgeInterface {
private static readonly SEND_MSG_CMD = 'MessageSvc.PbSendMsg';
+1 -1
View File
@@ -1,6 +1,6 @@
import { RequestUtil, cookieToString, getBknFromCookie } from './request-util';
import { createHash } from 'crypto';
import { readFileSync, statSync, createReadStream, writeFileSync, unlinkSync } from 'fs';
import { statSync, createReadStream, writeFileSync, unlinkSync } from 'fs';
import { basename, join } from 'path';
import { tmpdir } from 'os';
+1 -2
View File
@@ -186,7 +186,6 @@ export async function uploadGroupNoticeImage(
const body = Buffer.concat(parts);
const url = 'https://web.qun.qq.com/cgi-bin/announce/upload_img';
const options = {
hostname: 'web.qun.qq.com',
path: '/cgi-bin/announce/upload_img',
@@ -198,7 +197,7 @@ export async function uploadGroupNoticeImage(
},
};
return new Promise((resolve, reject) => {
return new Promise((resolve) => {
const req = https.request(options, (res) => {
let data = '';
res.on('data', (chunk) => { data += chunk; });