workspace: update eslint rule (#1027)

This commit is contained in:
undefined authored and GitHub committed 2025-08-06 18:51:25 +01:00
1 parent 05c3b8f2bd
commit cee3c00ddb
150 files changed
+1069 -1043

No files matched your search

+26 -26
View File
@@ -1,38 +1,38 @@
c:
compile: /usr/bin/gcc -O2 -Wall -std=c99 -o foo foo.c -lm
compile: /usr/bin/gcc -O2 -Wall -std=c99 -o foo foo.c -lm
cc:
compile: /usr/bin/g++ -O2 -Wall -std=c++11 -o foo foo.cc -lm
compile: /usr/bin/g++ -O2 -Wall -std=c++11 -o foo foo.cc -lm
pas:
compile: /usr/bin/fpc -O2 -ofoo foo.pas
compile: /usr/bin/fpc -O2 -ofoo foo.pas
java:
compile: /usr/bin/bash -c "javac -d /w -encoding utf8 ./Main.java && jar cvf Main.jar *.class >/dev/null"
code_file: Main.java
target: Main.jar
execute: /usr/bin/java -Dfile.encoding="UTF-8" -cp Main.jar Main
time_limit_rate: 2
compile_time_limit: 30000
compile_memory_limit: 1024
compile: /usr/bin/bash -c "javac -d /w -encoding utf8 ./Main.java && jar cvf Main.jar *.class >/dev/null"
code_file: Main.java
target: Main.jar
execute: /usr/bin/java -Dfile.encoding="UTF-8" -cp Main.jar Main
time_limit_rate: 2
compile_time_limit: 30000
compile_memory_limit: 1024
py3:
compile: /usr/bin/python3 -c "import py_compile; py_compile.compile('/w/foo.py', '/w/foo', doraise=True)"
code_file: foo.py
execute: /usr/bin/python3 foo
compile: /usr/bin/python3 -c "import py_compile; py_compile.compile('/w/foo.py', '/w/foo', doraise=True)"
code_file: foo.py
execute: /usr/bin/python3 foo
php:
execute: /usr/bin/php foo.php
execute: /usr/bin/php foo.php
rs:
compile: /usr/bin/rustc -O -o /w/foo /w/foo.rs
compile_time_limit: 30000
compile: /usr/bin/rustc -O -o /w/foo /w/foo.rs
compile_time_limit: 30000
hs:
compile: /usr/bin/ghc -O -outputdir /tmp -o /w/foo /w/foo.hs
compile_time_limit: 30000
compile: /usr/bin/ghc -O -outputdir /tmp -o /w/foo /w/foo.hs
compile_time_limit: 30000
js:
execute: /usr/bin/jsc foo.js
execute: /usr/bin/jsc foo.js
go:
compile: /usr/bin/go build -o /w/foo /w/foo.go
compile_time_limit: 30000
compile: /usr/bin/go build -o /w/foo /w/foo.go
compile_time_limit: 30000
rb:
execute: /usr/bin/ruby foo.rb
compile_time_limit: 30000
execute: /usr/bin/ruby foo.rb
compile_time_limit: 30000
cs:
compile: /usr/bin/mcs csc -optimize+ -out:/w/foo.exe /w/foo.cs
execute: /usr/bin/mono foo.exe
compile_time_limit: 30000
compile: /usr/bin/mcs csc -optimize+ -out:/w/foo.exe /w/foo.cs
execute: /usr/bin/mono foo.exe
compile_time_limit: 30000
+1 -1
View File
@@ -36,4 +36,4 @@ Unknown language type.: 未知的语言类型。
Unsupported language {0}.: 不支持的语言 {0}。
User output longer than standard answer.: 选手输出比标准输出长。
You did not specify a checker.: 你没有指定比较器文件。
Your program returned {0}.: 您的程序返回了{0}。
Your program returned {0}.: 您的程序返回了{0}。
+1 -1
View File
@@ -8,7 +8,7 @@
"dependencies": {
"@hydrooj/common": "workspace:^",
"@hydrooj/utils": "workspace:^",
"@zip.js/zip.js": "^2.7.71",
"@zip.js/zip.js": "^2.7.72",
"cac": "^6.7.14",
"p-queue": "^8.1.0",
"schemastery": "^3.16.1",
+3 -4
View File
@@ -17,9 +17,9 @@ export interface CheckConfig {
}
type Checker = (config: CheckConfig) => Promise<{
status: number,
score: number,
message: string,
status: number;
score: number;
message: string;
}>;
function parseDiffMsg(msg: string) {
@@ -206,7 +206,6 @@ const checkers: Record<string, Checker> = new Proxy({
* stderr:输出错误报告
*/
async syzoj(config) {
// eslint-disable-next-line prefer-const
let { status, stdout, stderr } = await runQueued(config.execute, {
copyIn: {
input: config.input,
+3 -3
View File
@@ -1,9 +1,9 @@
import { STATUS_TEXTS } from '@hydrooj/common';
interface CompileErrorInfo {
stdout?: string,
stderr?: string,
status?: number
stdout?: string;
stderr?: string;
status?: number;
}
export class CompileError extends Error {
+1 -1
View File
@@ -10,7 +10,7 @@ interface Task {
compile: () => Promise<void>;
judgeCase: (c: NormalizedCase) => (
(ctx: Context, ctxSubtask: ContextSubTask, runner?: Function) => Promise<JudgeResultBody['case']>
)
);
}
const Score = {
+1 -1
View File
@@ -33,7 +33,7 @@ export async function judge({
if (!Object.keys(config.answers).length) throw new FormatError('Invalid standard answer.');
for (const key in config.answers) {
const ansInfo = config.answers[key] as [string | string[], number] | Record<string, number>;
// eslint-disable-next-line @typescript-eslint/no-loop-func
// eslint-disable-next-line ts/no-loop-func
const report = (status: STATUS, score: number, message: string) => {
const [subtaskId, caseId] = key.split('-').map(Number);
totalScore += score;
+2 -2
View File
@@ -27,8 +27,8 @@ export class Stream extends EventEmitter {
break;
case 2:
this.emit('output', {
index: (data[1] >> 4) & 0xf,
fd: (data[1]) & 0xf,
index: (data[1] >> 4) & 0xF,
fd: (data[1]) & 0xF,
content: data.subarray(2),
});
break;
+1 -1
View File
@@ -1,6 +1,6 @@
import { DetailType, STATUS } from '@hydrooj/common';
const operation = /^\s*(status|score)\((\d+)\)\s*(.*)$/m;
const operation = /^\s*(status|score)\((\d+)\)\s*((\S|$).*)$/m;
export function parse(output: string, fullscore: number, detail: DetailType) {
let status = STATUS.STATUS_WRONG_ANSWER;
+2 -2
View File
@@ -4,7 +4,7 @@ import { CompilableSource } from '@hydrooj/common';
import { fs } from '@hydrooj/utils';
import { FormatError } from './error';
const EMPTY_STR = /^[ \r\n\t]*$/i;
const EMPTY_STR = /^[ \r\n\t]*$/;
export const cmd = parse;
@@ -34,7 +34,7 @@ export function compilerText(...messages: string[]) {
function restrictFile(p: string) {
if (!p) return '/';
if (p[0] === '/') p = '';
return p.replace(/\.\./gmi, '');
return p.replace(/\.\./g, '');
}
export function ensureFile(folder: string) {