Skip to content

Commit 094bd63

Browse files
committed
lint --fix
1 parent 67852bd commit 094bd63

File tree

19 files changed

+101
-109
lines changed

19 files changed

+101
-109
lines changed

src/main/services/AutoScoreService.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,9 @@ export class AutoScoreService extends Service {
432432
break
433433
}
434434
case 'set_student_status': {
435-
this.logger.info(`Set student status action: ${action.value} (not implemented - student type has no status field)`)
435+
this.logger.info(
436+
`Set student status action: ${action.value} (not implemented - student type has no status field)`
437+
)
436438
break
437439
}
438440
default:

src/renderer/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import { Wizard } from './components/Wizard'
77
import { ThemeProvider } from './contexts/ThemeContext'
88
import { ThemeEditorProvider } from './contexts/ThemeEditorContext'
99
import { ThemeEditor } from './components/ThemeEditor'
10-
import { useTheme } from './contexts/ThemeContext';
10+
import { useTheme } from './contexts/ThemeContext'
1111

1212
function MainContent(): React.JSX.Element {
1313
const navigate = useNavigate()
1414
const location = useLocation()
15-
const { currentTheme } = useTheme();
15+
const { currentTheme } = useTheme()
1616

1717
useEffect(() => {
1818
if (!(window as any).api) return

src/renderer/src/components/AutoScoreManager.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState, useEffect } from 'react'
1+
import { useState, useEffect } from 'react'
22
import { AddIcon, MoveIcon } from 'tdesign-icons-react'
33
import { allTriggers, allActions, triggerRegistry, actionRegistry } from './com.automatically'
44
import type { TriggerItem, ActionItem } from './com.automatically/types'
@@ -278,9 +278,7 @@ export const AutoScoreManager: React.FC = () => {
278278
}
279279

280280
const handleTriggerChange = (id: number, eventName: string) => {
281-
setTriggerList((prev) =>
282-
prev.map((t) => (t.id === id ? { ...t, eventName, value: '' } : t))
283-
)
281+
setTriggerList((prev) => prev.map((t) => (t.id === id ? { ...t, eventName, value: '' } : t)))
284282
}
285283

286284
const handleTriggerValueChange = (id: number, value: string) => {
@@ -310,9 +308,7 @@ export const AutoScoreManager: React.FC = () => {
310308
}
311309

312310
const handleActionChange = (id: number, eventName: string) => {
313-
setActionList((prev) =>
314-
prev.map((a) => (a.id === id ? { ...a, eventName, value: '' } : a))
315-
)
311+
setActionList((prev) => prev.map((a) => (a.id === id ? { ...a, eventName, value: '' } : a)))
316312
}
317313

318314
const handleActionValueChange = (id: number, value: string) => {
@@ -565,7 +561,10 @@ export const AutoScoreManager: React.FC = () => {
565561
if (editingRuleId !== null) {
566562
const values = form.getFieldsValue(true) as unknown as AutoScoreRuleFormValues
567563
const studentNames = Array.isArray(values.studentNames) ? values.studentNames : []
568-
const triggersPayload = triggerList.map((t) => ({ event: t.eventName, value: t.value }))
564+
const triggersPayload = triggerList.map((t) => ({
565+
event: t.eventName,
566+
value: t.value
567+
}))
569568
const actionsPayload = actionList.map((a) => ({
570569
event: a.eventName,
571570
value: a.value,
Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
import { useEffect } from "react";
1+
import { useEffect } from 'react'
22

3-
import Prism from "prismjs";
4-
import { useTheme } from '../contexts/ThemeContext';
3+
import Prism from 'prismjs'
4+
import { useTheme } from '../contexts/ThemeContext'
55

66
// 预先导入所有主题
7-
import "prismjs/themes/prism-coy.min.css";
8-
import "prismjs/themes/prism-okaidia.min.css";
7+
import 'prismjs/themes/prism-coy.min.css'
8+
import 'prismjs/themes/prism-okaidia.min.css'
99

1010
const Code = ({ code, language }) => {
11-
const { currentTheme } = useTheme();
11+
const { currentTheme } = useTheme()
1212

13-
useEffect(() => {
14-
// 重新高亮代码
15-
Prism.highlightAll();
16-
}, [currentTheme, code, language]);
13+
useEffect(() => {
14+
// 重新高亮代码
15+
Prism.highlightAll()
16+
}, [currentTheme, code, language])
1717

18-
// 根据主题设置不同的类名
19-
const isDark = currentTheme?.mode === 'dark';
18+
// 根据主题设置不同的类名
19+
const isDark = currentTheme?.mode === 'dark'
2020

21-
return (
22-
<div
23-
style={{
24-
opacity: "0.6",
25-
// 根据主题动态设置样式
26-
backgroundColor: isDark ? '#282c34' : '#f5f2f0',
27-
color: isDark ? '#abb2bf' : '#383a42',
28-
padding: '16px',
29-
borderRadius: '8px',
30-
overflow: 'auto'
31-
}}
32-
>
33-
<pre className={isDark ? 'prism-okaidia' : 'prism-coy'}>
34-
<code className={`language-${language}`}>{code}</code>
35-
</pre>
36-
</div>
37-
);
38-
};
21+
return (
22+
<div
23+
style={{
24+
opacity: '0.6',
25+
// 根据主题动态设置样式
26+
backgroundColor: isDark ? '#282c34' : '#f5f2f0',
27+
color: isDark ? '#abb2bf' : '#383a42',
28+
padding: '16px',
29+
borderRadius: '8px',
30+
overflow: 'auto'
31+
}}
32+
>
33+
<pre className={isDark ? 'prism-okaidia' : 'prism-coy'}>
34+
<code className={`language-${language}`}>{code}</code>
35+
</pre>
36+
</div>
37+
)
38+
}
3939

40-
export default Code;
40+
export default Code

src/renderer/src/components/com.automatically/ActionItem.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react'
21
import { Button, Select } from 'tdesign-react'
32
import { Delete1Icon } from 'tdesign-icons-react'
43
import { actionRegistry, allActions } from './registry'
@@ -12,12 +11,12 @@ interface ActionItemProps {
1211
onReasonChange: (id: number, reason: string) => void
1312
}
1413

15-
const ActionItem: React.FC<ActionItemProps> = ({
16-
item,
17-
onDelete,
18-
onChange,
19-
onValueChange,
20-
onReasonChange
14+
const ActionItem: React.FC<ActionItemProps> = ({
15+
item,
16+
onDelete,
17+
onChange,
18+
onValueChange,
19+
onReasonChange
2120
}) => {
2221
const definition = actionRegistry.get(item.eventName)
2322
const Component = definition?.component

src/renderer/src/components/com.automatically/TriggerItem.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ const TriggerItem: React.FC<TriggerItemProps> = ({ item, onDelete, onChange, onV
3131
onChange={(value) => onChange(item.id, value as string)}
3232
/>
3333
{Component && (
34-
<Component
35-
value={item.value}
36-
onChange={(value) => onValueChange(item.id, value)}
37-
/>
34+
<Component value={item.value} onChange={(value) => onValueChange(item.id, value)} />
3835
)}
3936
</div>
4037
)

src/renderer/src/components/com.automatically/actions/AddScoreAction.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react'
21
import { Input } from 'tdesign-react'
32
import type { ActionComponentProps } from '../types'
43

@@ -7,7 +6,12 @@ export const label = '添加分数'
76
export const description = '为学生添加分数'
87
export const hasReason = true
98

10-
const AddScoreAction: React.FC<ActionComponentProps> = ({ value, reason, onChange, onReasonChange }) => {
9+
const AddScoreAction: React.FC<ActionComponentProps> = ({
10+
value,
11+
reason,
12+
onChange,
13+
onReasonChange
14+
}) => {
1115
return (
1216
<>
1317
<Input

src/renderer/src/components/com.automatically/actions/AddTagAction.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react'
21
import { Input } from 'tdesign-react'
32
import type { ActionComponentProps } from '../types'
43

src/renderer/src/components/com.automatically/actions/SendNotificationAction.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react'
21
import { Input } from 'tdesign-react'
32
import type { ActionComponentProps } from '../types'
43

src/renderer/src/components/com.automatically/actions/SetStudentStatusAction.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react'
21
import { Select } from 'tdesign-react'
32
import type { ActionComponentProps } from '../types'
43

0 commit comments

Comments
 (0)