fix ci warnings

This commit is contained in:
undefined committed 2025-07-24 14:00:13 +08:00
1 parent 98d9ddf97a
commit 4b2d4c74cd
13 files changed
+30 -22

No files matched your search

+3 -3
View File
@@ -8,9 +8,9 @@
"@eslint-react/eslint-plugin": "^1.52.3",
"@eslint/compat": "^1.3.1",
"@eslint/eslintrc": "^3.3.1",
"@stylistic/eslint-plugin": "^5.2.1",
"@typescript-eslint/eslint-plugin": "^8.37.0",
"@typescript-eslint/parser": "^8.37.0",
"@stylistic/eslint-plugin": "^5.2.2",
"@typescript-eslint/eslint-plugin": "^8.38.0",
"@typescript-eslint/parser": "^8.38.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-plugin-de-morgan": "^1.3.0",
"eslint-plugin-github": "^6.0.0",
+2 -2
View File
@@ -53,11 +53,11 @@
"mongodb-memory-server": "10.1.4",
"nyc": "^17.1.0",
"ora": "^8.2.0",
"oxlint": "^1.7.0",
"oxlint": "^1.8.0",
"package-json": "^10.0.1",
"semver": "^7.7.2",
"simple-git": "^3.28.0",
"supertest": "^7.1.3",
"supertest": "^7.1.4",
"supports-hyperlinks": "^4.1.0",
"typescript": "5.8.3",
"wtfnode": "^0.10.0"
+1 -1
View File
@@ -51,7 +51,7 @@ export default class ElasticSearchService extends Service {
},
});
let hits = res.hits.hits.map((i) => i._id);
if (!opts.skip) {
if (!opts?.skip) {
let pdoc = await ProblemModel.get(domainId, +q || q, ProblemModel.PROJECTION_LIST);
if (pdoc) {
hits = hits.filter((i) => i !== `${pdoc.domainId}/${pdoc.docId}`);
+2 -2
View File
@@ -8,13 +8,13 @@
"dependencies": {
"@hydrooj/common": "workspace:^",
"@hydrooj/utils": "workspace:^",
"@zip.js/zip.js": "^2.7.64",
"@zip.js/zip.js": "^2.7.68",
"cac": "^6.7.14",
"p-queue": "^8.1.0",
"schemastery": "^3.16.1",
"semver": "^7.7.2",
"shell-quote": "^1.8.3",
"superagent": "^10.2.2",
"superagent": "^10.2.3",
"ws": "^8.18.3"
},
"preferUnplugged": true,
+4 -1
View File
@@ -127,7 +127,10 @@ export class JudgeTask {
if (filenames.length) {
logger.info(`Getting problem data: ${this.session?.config.host || 'local'}/${source}`);
this.next({ message: 'Syncing testdata, please wait...' });
await this.session.fetchFile(source, Object.fromEntries(files.map((i) => [i.name, join(filePath, i.name)])));
await this.session.fetchFile(source, Object.fromEntries(
files.filter((i) => filenames.includes(i.name))
.map((i) => [i.name, join(filePath, i.name)]),
));
await fs.writeFile(join(filePath, 'etags'), JSON.stringify(version));
this.compileCache = {};
}
+3 -3
View File
@@ -23,7 +23,7 @@
"@hydrooj/utils": "workspace:^",
"@simplewebauthn/server": "13.1.2",
"@undefined-moe/require-resolve-hook": "^1.1.0",
"@zip.js/zip.js": "^2.7.64",
"@zip.js/zip.js": "^2.7.68",
"adm-zip": "0.5.16",
"cac": "^6.7.14",
"cordis": "4.0.0-beta.5",
@@ -38,7 +38,7 @@
"lru-cache": "^11.1.0",
"mime-types": "^3.0.1",
"moment-timezone": "^0.6.0",
"mongodb": "^6.17.0",
"mongodb": "^6.18.0",
"mongodb-uri": "^0.9.7",
"nanoid": "^5.1.5",
"nodemailer": "^7.0.5",
@@ -49,7 +49,7 @@
"schemastery": "^3.16.1",
"semver": "^7.7.2",
"shorty.js": "^1.0.1",
"superagent": "^10.2.2",
"superagent": "^10.2.3",
"tar": "6.2.1",
"thirty-two": "^1.0.2",
"ua-parser-js": "^2.0.4"
+1 -1
View File
@@ -195,7 +195,7 @@ export async function apply(ctx: Context) {
if (overrideLimit) maxOperations = overrideLimit;
// deprecated: remove boolean support in future
if (typeof defaultKey === 'boolean') defaultKey = defaultKey ? '{{user}}' : '{{ip}}';
const id = defaultKey.replace('{{ip}}', this.request.ip).replace('{{user}}', this.user._id);
const id = defaultKey.replace('{{ip}}', this.request.ip).replace('{{user}}', this.user?._id?.toString() || '0');
await opcount.inc(op, id, periodSecs, maxOperations);
},
renderTitle(str: string) {
+2 -2
View File
@@ -6,8 +6,8 @@
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0-or-later",
"dependencies": {
"mariadb": "^3.4.4",
"mongodb": "^6.17.0",
"mariadb": "^3.4.5",
"mongodb": "^6.18.0",
"turndown": "^7.2.0",
"xml2js": "^0.6.2"
},
@@ -9,7 +9,7 @@ import ReactDOM from 'react-dom/client';
import { AutoloadPage } from 'vj/misc/Page';
import { request } from 'vj/utils';
function renderReactions(reactions, self, rootEle) {
function renderReactions(reactions = {}, self = {}, rootEle) {
let html = '';
for (const [k, v] of Object.entries(reactions).sort(([, v1], [, v2]) => +v2 - +v1)) {
if (!v) continue;
@@ -50,12 +50,17 @@ export default new AutoloadPage('omnibar', () => {
href={`${base}/p/${pid || docId}`}
>
<div>
<a
href={psdict[`${domainId}#${docId}`]?.rid && `${base}/record/${psdict[`${domainId}#${docId}`]?.rid}`}
<p
onClick={(ev) => {
if (psdict[`${domainId}#${docId}`]?.rid) {
window.location.href = `${base}/record/${psdict[`${domainId}#${docId}`]?.rid}`;
}
ev.preventDefault();
}}
className={`record-status--text ${STATUS_CODES[psdict[`${domainId}#${docId}`]?.status]}`}
>
<span className={`icon record-status--icon ${STATUS_CODES[psdict[`${domainId}#${docId}`]?.status]}`}></span>
</a>
</p>
<div>{title}</div>
</div>
<div>
+1 -1
View File
@@ -72,7 +72,7 @@
"monaco-editor": "0.52.2",
"monaco-editor-nls": "^3.1.0",
"monaco-editor-webpack-plugin": "^7.1.0",
"monaco-themes": "^0.4.5",
"monaco-themes": "^0.4.6",
"monaco-yaml": "5.1.1",
"nanoid": "^5.1.5",
"normalize.css": "^8.0.1",
@@ -42,7 +42,7 @@ const page = new NamedPage(['contest_edit', 'contest_create', 'homework_create',
});
}
const message = `Confirm deleting this ${pagename.split('_')[0]}? Its files and status will be deleted as well.`;
confirm(i18n(message)).then((yes) => {
return confirm(i18n(message)).then((yes) => {
if (yes) {
confirmed = true;
ev.target.click();
+1 -1
View File
@@ -16,6 +16,6 @@
"@types/react": "^18.3.23",
"@types/react-dom": "^18.3.7",
"@vitejs/plugin-react-swc": "^3.11.0",
"vite": "^7.0.5"
"vite": "^7.0.6"
}
}