patch eslint rules

This commit is contained in:
undefined committed 2026-03-30 20:02:19 +08:00
1 parent 403a762da1
commit 642662f505
15 files changed
+24 -19

No files matched your search

+2 -2
View File
@@ -1,7 +1,7 @@
import moment from 'moment-timezone';
import { Context } from '../context';
import db from '../service/db';
import { ArgMethod } from '../utils';
import { ArgMethod, Time } from '../utils';
let coll = db.collection('blacklist');
@@ -12,7 +12,7 @@ class BlackListModel {
if (expire === 0) expireAt = moment().add(1000, 'months').toDate();
else if (typeof expire === 'number') expireAt = moment().add(expire, 'months').toDate();
else if (expire instanceof Date) expireAt = expire;
else expireAt = new Date(new Date().getTime() + 365 * 24 * 60 * 60 * 1000);
else expireAt = new Date(Date.now() + 365 * Time.day);
return await coll.findOneAndUpdate(
{ _id: id },
{ $set: { expireAt } },
+1 -1
View File
@@ -78,7 +78,7 @@ export function isLocked(tdoc: Tdoc, time = new Date()) {
}
export function isExtended(tdoc: Tdoc) {
const now = new Date().getTime();
const now = Date.now();
return tdoc.penaltySince.getTime() <= now && now < tdoc.endAt.getTime();
}
+1 -1
View File
@@ -4,7 +4,7 @@ import db from '../service/db';
const coll = db.collection('opcount');
export async function inc(op: string, ident: string, periodSecs: number, maxOperations: number) {
const now = new Date().getTime();
const now = Date.now();
const expireAt = new Date(now - (now % (periodSecs * 1000)) + periodSecs * 1000);
try {
const res = await coll.findOneAndUpdate({