workspace: apply eslint edits

This commit is contained in:
undefined committed 2025-03-21 09:48:17 +08:00
1 parent 040f7d8863
commit 0e7f5fe635
63 files changed
+47 -96

No files matched your search

@@ -1,5 +1,3 @@
/* eslint-disable jsx-a11y/role-supports-aria-props */
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
import { debounce, uniqueId } from 'lodash';
import React, {
forwardRef, useEffect,
@@ -83,7 +81,7 @@ function DraggableSelection({
const AutoComplete = forwardRef(function Impl<T>(props: AutoCompleteProps<T>, ref: React.Ref<AutoCompleteHandle<T>>) {
const {
multi = false, width = '100%', height = 'auto',
freeSolo = false, allowEmptyQuery = false, listStyle = {},
freeSolo = false, allowEmptyQuery = false, listStyle = {}, // eslint-disable-line @eslint-react/no-unstable-default-props
disabled = false, disabledHint = '', draggable = multi,
} = props;
const queryItems = props.queryItems ?? (() => []);
@@ -333,7 +331,7 @@ const AutoComplete = forwardRef(function Impl<T>(props: AutoCompleteProps<T>, re
key={itemKey(item)}
onClick={() => toggleItem(item)}
onMouseMove={() => setCurrentItem(idx)}
aria-selected={selectedKeys.includes(itemKey(item))}
data-selected={selectedKeys.includes(itemKey(item))}
data-focus={idx === currentItem}
>
<div>{renderItem(item)}</div>
@@ -4,7 +4,6 @@ import React, { forwardRef } from 'react';
import { api, gql } from 'vj/utils';
import AutoComplete, { AutoCompleteHandle, AutoCompleteProps } from './AutoComplete';
// eslint-disable-next-line prefer-arrow-callback
const UserSelectAutoComplete = forwardRef<AutoCompleteHandle<Udoc>, AutoCompleteProps<Udoc>>((props, ref) => (
<AutoComplete<Udoc>
ref={ref as any}
@@ -1,3 +1,4 @@
/* eslint-disable no-lone-blocks */
import $ from 'jquery';
import _ from 'lodash';
import moment from 'moment';
@@ -208,7 +209,7 @@ export default class Calendar {
const now = moment();
days.forEach((day) => {
day.current = day.date.isSame(now, 'day'); // eslint-disable-line no-param-reassign
day.current = day.date.isSame(now, 'day');
});
const daysByWeek = _.chunk(days, 7);
@@ -80,7 +80,7 @@ function initConn(path: string, port: MessagePort, cookie: any) {
};
}
self.onconnect = function (e) { // eslint-disable-line no-undef
self.onconnect = function (e) {
const port = e.ports[0];
port.addEventListener('message', (msg: { data: RequestPayload }) => {
@@ -1,6 +1,6 @@
/* eslint-disable react-refresh/only-export-components */
import { diffLines } from 'diff';
import type { ProblemConfigFile, TestCaseConfig } from 'hydrooj/src/interface';
import { diffLines } from 'diff';
import $ from 'jquery';
import yaml from 'js-yaml';
import { isEqual } from 'lodash';
@@ -1,8 +1,8 @@
import { normalizeSubtasks, readSubtasksFromFiles } from '@hydrooj/common';
import { TestCaseConfig } from 'hydrooj';
import {
Button, Classes, Icon, Popover, TreeNode,
} from '@blueprintjs/core';
import { normalizeSubtasks, readSubtasksFromFiles } from '@hydrooj/common';
import { TestCaseConfig } from 'hydrooj';
import { isEqual } from 'lodash';
import React from 'react';
import { DndProvider, useDrop } from 'react-dnd';
@@ -1,6 +1,6 @@
import { parseMemoryMB, parseTimeMS, sortFiles } from '@hydrooj/utils/lib/common';
import Ajv from 'ajv';
import type { ProblemConfigFile, TestCaseConfig } from 'hydrooj/src/interface';
import Ajv from 'ajv';
import yaml from 'js-yaml';
import { cloneDeep } from 'lodash';
import schema from '../../monaco/schema/problemconfig';
@@ -1,7 +1,7 @@
import { readSubtasksFromFiles } from '@hydrooj/common';
import {
Button, Classes, Dialog, DialogBody, DialogFooter, Icon,
} from '@blueprintjs/core';
import { readSubtasksFromFiles } from '@hydrooj/common';
import React, { useEffect, useRef } from 'react';
import { useSelector, useStore } from 'react-redux';
import { i18n } from 'vj/utils';
@@ -1,9 +1,9 @@
import { parseMemoryMB, parseTimeMS } from '@hydrooj/utils/lib/common';
import {
Button, ControlGroup,
Dialog, DialogBody, DialogFooter,
Icon, InputGroup, Tag,
} from '@blueprintjs/core';
import { parseMemoryMB, parseTimeMS } from '@hydrooj/utils/lib/common';
import { isEqual } from 'lodash';
import React, { useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';
@@ -1,7 +1,7 @@
import { TestCaseConfig } from 'hydrooj';
import {
ContextMenu, Menu, MenuItem, TreeNode,
} from '@blueprintjs/core';
import { TestCaseConfig } from 'hydrooj';
import { omit } from 'lodash';
import React from 'react';
import { useDrag } from 'react-dnd';
@@ -18,7 +18,6 @@ export default function DataInputComponent(props) {
wrap="off"
spellCheck="false"
>
{/* eslint-disable-next-line react/no-danger */}
<pre dangerouslySetInnerHTML={{ __html: value }} contentEditable />
</div>
) : (
@@ -1,4 +1,3 @@
/* eslint-disable react/static-property-placement */
import _ from 'lodash';
import PropTypes from 'prop-types';
import React from 'react';