workspace: add oxlint

This commit is contained in:
undefined committed 2025-03-10 16:16:34 +08:00
1 parent b48e70019a
commit cda3a8f855
18 files changed
+120 -44

No files matched your search

+1 -1
View File
@@ -464,7 +464,7 @@ class OauthCallbackHandler extends Handler {
break;
}
}
const set: Partial<Udoc> = { ...(r.set || {}), oauth: args.type };
const set: Partial<Udoc> = { ...r.set, oauth: args.type };
if (r.bio) set.bio = r.bio;
if (r.viewLang) set.viewLang = r.viewLang;
if (r.avatar) set.avatar = r.avatar;
+1 -1
View File
@@ -101,7 +101,7 @@ export const PERM = {
PERM_NEVER: 1n << 60n,
};
export const Permission = (family: string, key: BigInt, desc: string) => ({ family, key, desc });
export const Permission = (family: string, key: bigint, desc: string) => ({ family, key, desc });
export const PERMS = [
Permission('perm_general', PERM.PERM_VIEW, 'View this domain'),
+11 -11
View File
@@ -15,22 +15,22 @@ import { ArrayKeys, MaybeArray, NumberKeys, Projection } from '../typeutils';
import { buildProjection } from '../utils';
type DocID = ObjectId | string | number;
type NormalArrayKeys<O, P = any> = Exclude<ArrayKeys<O, P>, Symbol>;
type NormalArrayKeys<O, P = any> = Exclude<ArrayKeys<O, P>, symbol>;
export const coll = db.collection('document');
export const collStatus = db.collection('document.status');
export const TYPE_PROBLEM: 10 = 10;
export const TYPE_PROBLEM_SOLUTION: 11 = 11;
export const TYPE_PROBLEM_LIST: 12 = 12;
export const TYPE_DISCUSSION_NODE: 20 = 20;
export const TYPE_DISCUSSION: 21 = 21;
export const TYPE_DISCUSSION_REPLY: 22 = 22;
export const TYPE_CONTEST: 30 = 30;
export const TYPE_CONTEST_CLARIFICATION: 31 = 31;
export const TYPE_TRAINING: 40 = 40;
export const TYPE_PROBLEM = 10 as const;
export const TYPE_PROBLEM_SOLUTION = 11 as const;
export const TYPE_PROBLEM_LIST = 12 as const;
export const TYPE_DISCUSSION_NODE = 20 as const;
export const TYPE_DISCUSSION = 21 as const;
export const TYPE_DISCUSSION_REPLY = 22 as const;
export const TYPE_CONTEST = 30 as const;
export const TYPE_CONTEST_CLARIFICATION = 31 as const;
export const TYPE_TRAINING = 40 as const;
/** @deprecated use `TYPE_CONTEST` with rule `homework` instead. */
export const TYPE_HOMEWORK: 60 = 60;
export const TYPE_HOMEWORK = 60 as const;
export interface DocType {
[TYPE_PROBLEM]: ProblemDoc;
+1 -1
View File
@@ -58,4 +58,4 @@ export { EventMap } from './service/bus';
export { db, pwsh };
// to load ctx.scoreboard
export { } from './handler/contest';
export { } from './handler/contest'; // eslint-disable-line @typescript-eslint/no-useless-empty-export
+1
View File
@@ -242,6 +242,7 @@ export default class HMR extends Service {
for (const [plugin, { filename, runtime }] of reloads) {
try {
this.ctx.registry.delete(attempts[filename]);
// eslint-disable-next-line no-await-in-loop
await reload(plugin, runtime);
} catch (err) {
logger.warn(err);
+1 -1
View File
@@ -51,7 +51,7 @@ export const coreScripts: MigrationScript[] = [
return true;
},
// Init
...new Array(28).fill(unsupportedUpgrade),
...new Array(28).fill(unsupportedUpgrade), // oxlint-disable-line no-new-array
async function _29_30() {
return await iterateAllDomain((ddoc) => RecordModel.coll.updateMany({ domainId: ddoc._id }, { $set: { pdomain: ddoc._id } }));
},