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

+2 -1
View File
@@ -2,7 +2,7 @@ import * as status from '@hydrooj/common/status';
import { findFileSync } from '@hydrooj/utils/lib/utils';
import { convert } from 'html-to-text';
import {
avatar, Context, fs, PERM, PRIV, Service, STATUS, yaml,
avatar, Context, difficultyAlgorithm, fs, PERM, PRIV, Service, STATUS, yaml,
} from 'hydrooj';
import jsesc from 'jsesc';
import nunjucks from 'nunjucks';
@@ -134,6 +134,7 @@ class Nunjucks extends nunjucks.Environment {
this.addGlobal('avatarUrl', avatar);
this.addGlobal('formatSeconds', misc.formatSeconds);
this.addGlobal('model', global.Hydro.model);
this.addGlobal('lib', { difficulty: difficultyAlgorithm });
this.addGlobal('ui', global.Hydro.ui);
this.addGlobal('isIE', (str) => {
if (!str) return false;
@@ -38,7 +38,7 @@ export default function reducer(state = {}, action = {}) {
return {
...state,
[to]: {
...state[to] || {},
...state[to],
udoc,
messages: [
...state[to]?.messages || [],
@@ -242,7 +242,7 @@ const page = new NamedPage(['problem_detail', 'contest_detail_problem', 'homewor
function ProblemNavigation() {
[, setUpdate] = React.useState(0);
return <div className="contest-problems" style={{ margin: '1em' }}>
{pids.map((i) => <a href={`#p${i}`} className={ans[i] ? 'pending ' : ''}>
{pids.map((i) => <a href={`#p${i}`} key={i} className={ans[i] ? 'pending ' : ''}>
<span className="id">{i}</span>
</a>)}
</div>;
+1 -1
View File
@@ -160,12 +160,12 @@ async function get(request: Request) {
method: request.method,
credentials: isResource ? 'same-origin' : 'include',
headers: request.headers,
body: request.body,
redirect: request.redirect,
keepalive: request.keepalive,
referrer: request.referrer,
referrerPolicy: request.referrerPolicy,
signal: request.signal,
...(request.method.toLowerCase() === 'get' ? {} : { body: request.body }),
});
if (r.ok) {
console.log('Load success from ', source.toString());